YUYU_M1 Image to Video
YUYU_M1 produces videos that are always 5 seconds long and always with audio, with resolution determined automatically from the image. It has the fewest settings and the fastest output, making it a good fit when you want videos quickly.
POST /api/tasks/video-generation
X-Api-Key: sk-live-xxxx
Content-Type: application/json
Idempotency-Key: optional, see below
Full example
images takes a base64 data URI. PNG, JPEG, and WebP are supported. The actual base64 content is omitted in the example:
curl -X POST https://yuyuvideo.com/api/tasks/video-generation \
-H "X-Api-Key: sk-live-xxxx" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-20260716-00042" \
-d '{
"model": "YUYU_M1",
"prompt": "a woman waving at the camera, cinematic lighting",
"images": ["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."],
"duration": 5,
"seed": 1234567,
"payload": { "external_order_id": "order-20260716-00042" },
"callback_url": "https://example.com/webhooks/yuyu-video"
}'
On success, the API returns 201 Created with the task data. At this point the task is still queued and files is empty. credits is the number of credits charged for this request; the number in the example is for reference only:
{
"public_id": "01K1M2N3P4Q5R6S7T8V9W0XY12",
"type": 1,
"status": 0,
"credits": 10,
"params": {
"model": "YUYU_M1",
"prompt": "a woman waving at the camera, cinematic lighting",
"images": ["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."],
"duration": 5,
"audio": true,
"seed": 1234567,
"prompt_enhance": false,
"payload": { "external_order_id": "order-20260716-00042" },
"callback_url": "https://example.com/webhooks/yuyu-video"
},
"error_code": null,
"error_message": null,
"created_at": "2026-07-16T08:00:00.000000Z",
"finished_at": null,
"files_expire_at": null,
"files_expired": false,
"files": []
}
To learn how to check progress and download the video, see Query Tasks and Download Results.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
model |
string | Yes | Set to YUYU_M1 |
prompt |
string | Yes | Video description, up to 10000 characters |
images |
string[] | Yes | Exactly 1 image, as a base64 data URI (data:image/{png|jpeg|webp};base64,...) |
duration |
integer | Yes | Must be 5 and cannot be omitted. Any other value returns 422 |
audio |
boolean | No | Must be true. Any other value returns 422 |
seed |
integer | No | Random seed, 1–2147483647. If omitted, a random seed is used each time |
resolution |
— | No | Not supported; returns 422 if sent |
prompt_enhance |
boolean | No | Prompt enhancement, default false. When set to true, the system first enhances your prompt and then generates the video, at an additional credit cost. The actual amount is the credits value in the response |
payload |
object | No | Custom data, such as your order number. The system does not read or modify it, and returns it as-is when you query the task and in webhook notifications |
callback_url |
string | No | URL to notify when the task finishes. Must start with https, up to 2000 characters. See Callbacks (Webhook) |
Parameters not listed in the table (except age_declared; see Pre-generation Age Check) return 422 if sent. They are not ignored.
Idempotency-Key
Use this to avoid creating duplicate tasks. Send a custom string in the header. We recommend a value that never repeats, such as an order number from your system:
Idempotency-Key: order-20260711-00042
If you send repeated requests with the same API key and the same Idempotency-Key within a short period, only one task is created and credits are charged only once. Subsequent duplicate requests return 200 OK with the original task.
Without this header, every request creates a new task.
Errors
| Status code | Cause | Response |
|---|---|---|
422 |
Invalid parameters, such as a missing required field, wrong type, images not containing exactly 1 image, or a disallowed value for duration / audio / resolution |
The errors field lists the error for each field |
422 |
prompt_enhance: true was set, but prompt enhancement is temporarily unavailable |
{ "message": "Prompt enhancement is temporarily unavailable", "errors": { "prompt_enhance": ["Prompt enhancement is temporarily unavailable"] } }. No task is created and no credits are charged. Set it to false or omit the parameter and send the request again |
422 |
model is set to a model that does not exist |
{ "message": "Unknown model alias: {model}" } |
402 |
Insufficient credits | { "message": "Insufficient credits to complete this charge." } |
429 |
Too many queued video tasks | { "message": "Too many pending tasks of this type; please retry later." }. Use the Retry-After header in the response to decide when to retry |
For charging rules, see Credits and Billing.