YUYU_N1 Image to Video

YUYU_N1 lets you customize the video length (2–15 seconds), resolution (720p / 1080p), and whether the video has audio, making it a good fit when you need to adjust specs to your source material.

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_N1",
    "prompt": "a woman waving at the camera, cinematic lighting",
    "images": ["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."],
    "duration": 5,
    "resolution": "720p",
    "audio": true,
    "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": 20,
  "params": {
    "model": "YUYU_N1",
    "prompt": "a woman waving at the camera, cinematic lighting",
    "images": ["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."],
    "duration": 5,
    "resolution": "720p",
    "audio": true,
    "seed": 1234567,
    "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_N1
prompt string Yes Video description, up to 1500 characters
images string[] Yes Exactly 1 image, as a base64 data URI (data:image/{png|jpeg|webp};base64,...)
duration integer No Video length 2–15 seconds, default 5. Each 5 seconds is one billing unit, with anything shorter than 5 seconds counted as 5 seconds. See Credits and Billing
audio boolean No Whether the video has audio. Default true
resolution string No 720p or 1080p. Default 720p
seed integer No Random seed. Must be an integer of 0 or greater
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)

If model is set to a model that does not exist, the API returns 422: Unknown model alias: {model}.

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, prompt longer than 1500 characters, or duration / resolution / audio outside the allowed range The errors field lists the error for each field
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.