Этот API предоставляет конечные точки для создания видео с помощью Midjourney. Он включает в себя две конечные точки:
- /Video_submit (POST): Отправляет запрос на генерацию видео. Требует аутентификации и вычитает 15 запросов из баланса пользователя из-за высоких вычислительных затрат.
- /Video_fetch (GET): Извлечает статус и результаты задачи по task_id. Не вычитает запросы.
API использует JSON для тел запросов и ответов. Аутентификация обрабатывается с помощью ключа API, переданного в заголовке x-token.
Base URL: https://api.kolersky.com/api/midjourney
Endpoint: /video_submit (POST)
ОписаниеОтправляет запрос на создание видео на основе URL-адреса изображения и дополнительной текстовой подсказки. Вычитает 15 запросов из баланса пользователя после успешной отправки.
MethodPOST
Required Headers- Content-Type: application/json
- x-token: <your-api-key>
Request Body (JSON)
Required:- url (string): A valid image URL (e.g., https://example.com/image.png). Must end with .png, .jpg, .jpeg or .webp.
Optional:- prompt (string): Optional text description to accompany the image URL (e.g., add a cat).
- motion (string): "low" or "high" (default: "low").
- videoType (string): "vid_1.1_i2v_480" or "vid_1.1_i2v_720" (default: "vid_1.1_i2v_480").
- mode (string): "fast" or "relax" (default: "fast").
- animateMode (string): "manual" or "automatic" (default: "manual").
Example:{
"url": "https://i.ibb.co/DHZT2zLz/1f29638d-67a8-467a-81e3-501e08cc073d.png",
"prompt": "add a cat",
"motion": "low",
"videoType": "vid_1.1_i2v_480",
"mode": "fast",
"animateMode": "manual"
}
Validation- Method must be POST.
- User must have at least 15 requests in their balance.
- Body must be valid JSON with allowed keys.
- url must be a non-empty string and a valid image URL.
- prompt, if provided, must be a string.
- motion, videoType, mode, and animateMode must match allowed values.
Responses- 200 OK: Task created successfully.
{
"task_id": "
1752337786244405",
"description": "Submit Success",
"code": 200
}
- 400 Bad Request: Invalid request (e.g., missing url, invalid image URL, invalid JSON, or incorrect parameter values).
{
"err": "Bad request, invalid image URL",
"code": 400
}
- 403 Forbidden: Insufficient balance or incorrect method.
{
"err": "Forbidden, you need at least 15 requests.",
"code": 403
}
- 502 Bad Gateway: External service error.
{
"err": "Unknown error",
"code": 502
}
Notes- Deducts 15 requests upon successful submission, even if the task later fails.
- The url and optional prompt are combined into a single prompt string (e.g., https://example.com/image.png add a cat) before being sent to the external service.
- Use the returned task_id to check task status with /video_fetch.
Endpoint: /video_fetch (GET)
DescriptionRetrieves the status and results of a video generation task by task_id. Does not deduct requests.
MethodGET
Query Parameters- task_id (string, required): ID of the task from /video_submit.
Example: https://api.kolersky.com/api/midjourney/video_fetch?task_id=
1752337786244405Required Headers- x-token: <your-api-key>
Responses- 200 OK: Task status and results.
PENDING: Task has been submitted but not yet processed.
{
"task_id": "
1752337786244405",
"action": "VIDEO",
"progress": "0%",
"status": "PENDING",
"code": 200
}
IN_PROGRESS: Task is currently being processed.
{
"task_id": "
1752337786244405",
"action": "VIDEO",
"progress": "50%",
"status": "IN_PROGRESS",
"code": 200
}
SUCCESS: Task completed successfully, with video URLs.
{
"task_id": "
1752337786244405",
"action": "VIDEO",
"progress": "100%",
"status": "SUCCESS",
"video_urls": [
"https://storage.fonedis.cc//video/.../0_0.mp4",
"https://storage.fonedis.cc//video/.../0_1.mp4",
"https://storage.fonedis.cc//video/.../0_2.mp4",
"https://storage.fonedis.cc//video/.../0_3.mp4"
],
"code": 200
}
FAILURE: Task failed, with reason provided.
{
"task_id": "
1752337786244405",
"action": "VIDEO",
"progress": "100%",
"status": "FAILURE",
"failReason": "Invalid prompt format",
"code": 200
}
- 400 Bad Request: Missing or invalid task_id.
{
"err": "Missing task_id",
"code": 400
}
- 403 Forbidden: Incorrect method.
{
"err": "Method not allowed",
"code": 403
}
- 502 Bad Gateway: External service error.
{
"err": "External service unavailable",
"code": 502
}
Notes- Poll this endpoint every 5 seconds until progress reaches "100%" or up to 5 minutes (60 attempts).
- If status is "SUCCESS", video_urls contains the generated video links.
- If status is "FAILURE", check failReason for details.
- If status is "PENDING" or "IN_PROGRESS", continue polling until completion.
General Errors- 400 Bad Request: Invalid request format or parameters.
- 403 Forbidden: Insufficient balance or incorrect method.
- 502 Bad Gateway: External service failure.
Usage1. Call /video_submit with a valid image URL and optional text prompt to create a task and obtain a task_id.
2. Poll /video_fetch with the task_id every 5 seconds until progress is "100%".
3. On completion, check status:
- If "SUCCESS", retrieve video links from video_urls.
- If "FAILURE", inspect failReason.
- If "PENDING" or "IN_PROGRESS", continue polling.
Example (curl)
Submit a task:curl -X POST https://api.kolersky.com/api/midjourney/video_submit \
-H "Content-Type: application/json" \
-H "x-token: YOUR_API_KEY" \
-d '{
"url": "https://i.ibb.co/DHZT2zLz/1f29638d-67a8-467a-81e3-501e08cc073d.png",
"prompt": "add a cat",
"motion": "low",
"videoType": "vid_1.1_i2v_480",
"mode": "fast",
"animateMode": "manual"
}'
Fetch task status:curl -X GET "https://api.kolersky.com/api/midjourney/video_fetch?task_id=
1752337786244405" \
-H "x-token: YOUR_API_KEY"
TestingUse tools like Postman or curl to test. Ensure your API key is valid and included in the x-token header.