Skip to content

Video Generation (text and multi-asset → video) ​

The platform's video capability is generation-oriented: submit a text description, optionally combined with reference images, video, and audio, and receive a generated video plus a download URL. First/last frame mode lets you specify the opening and closing frames; multi-asset reference mode references assets through the prompt.

yaoshu-video uses an asynchronous task model: submit a task → poll the status or receive a callback → download the video.

Task endpoints use the V3-style content array and support the prompt, numbered asset fields, and multipart extensions listed on this page. Integrate against the fields on this page; SDK parameters that are not listed here are out of scope.

All requests carry Authorization: Bearer <API_KEY>. The public API base URL is https://token.yaoshu.cc, and all examples use it. When calling, append the full endpoint paths listed on this page directly; do not add an extra /v1. Below, replace {task_id} with the task ID returned by submission, and replace the example asset URLs and local paths with your own real assets. The examples use command-line curl; on Windows PowerShell use curl.exe and that shell's line-continuation syntax, or collapse each command into a single line.

yaoshu-video supports 4–30 seconds, 480p / 720p, first/last frames, and multi-asset references. Actual availability depends on the current service route and the submission result; for model availability and pricing, see "Model Square" in the Console.

Specification summary (parameters that are omitted are submitted with their defaults; declare them explicitly to pin down the specification and billing tier):

ParameterValuesDefault
duration4–30 seconds5 seconds
resolution480p / 720p720p
ratio16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 21:9 / auto9:16
functionModeomni_reference / first_last_framesomni_reference
generate_audiotrue / falsetrue
AssetsUp to 30 images, 10 videos, 10 audio clips; 50 items in total—

1. Submitting a Task ​

MethodPathDescription
POST/api/v3/contents/generations/tasksCreate a task (returns 202 on success; the stable fields are id/task_id/status, optionally plus a created timestamp)
GET/api/v3/contents/generations/tasks/{task_id}Query a task (returns 404 task_not_found if it does not exist)
GET/api/v3/contents/generations/tasksTask list (page_num/page_size plus filter.status/filter.task_ids/filter.model; covers the last 7 days)

JSON requests can use either model + content array or model + prompt + numbered asset fields. content and the top-level prompt cannot be provided at the same time. To upload local files, use multipart: put the prompt in prompt and assets in the numbered fields. The total request body is at most 64MiB (including form boundaries and text fields); the same form field name must not be repeated; file fields that are not listed here are not accepted. URLs must be directly readable by the server without login, cookies, or extra authentication headers; public HTTPS URLs that return the asset body directly are recommended. Do not use web share pages, local paths, or Base64 strings in place of URLs.

Asset Preparation Requirements ​

The following are the conditions for preparing assets; individual service routes may impose stricter limits; a request is rejected when no available route satisfies it. Do not rely on automatic cropping, scaling, transcoding, or acceleration to fix out-of-limit assets.

AssetFormat and sizeDimensions and durationCount
ImageJPEG / PNG / WebP; animated images are not supported; under 10MiB per image after processingWidth and height each 300–6000 pixels; aspect ratio 0.4–2.5Up to 30 in multi-asset mode
VideoMP4 / MOV; at most 50MiB eachWidth and height each 300–6000 pixels; aspect ratio 0.4–2.5; width×height 409600–8295044; 2–30 seconds per clip, and the actual total duration of all reference videos is at most 30 secondsUp to 10
AudioMP3 / WAV / M4A; at most 15MiB eachAt least 2 seconds per clip; the actual total duration of all reference audio is at most 30 secondsUp to 10

Multi-asset mode allows at most 50 images, videos, and audio clips combined. The asset count limits do not exempt the 64MiB total request body limit: when multiple files add up to too large a size, switch to public URLs. A reference video URL must return the same content during metering and generation.

content array entry types:

typeDescription
textText prompt; when using the content array, describe the video through this entry's text field
image_urlImage URL; role=reference_image (default) is a normal reference image, first_frame / last_frame are the first / last frame respectively, and they cannot be mixed with normal reference images
video_urlVideo URL; role=reference_video marks a reference video; use a directly downloadable HTTPS URL
audio_urlAudio URL; role=reference_audio marks reference audio; use a directly downloadable HTTPS URL

Inputs that are explicitly rejected (400; they are never silently ignored and billed as an ordinary generation):

  • size / width / height parameters — this endpoint only accepts the resolution tier (the response says Unknown video parameter)
  • Service routes without asset capability reject reference video/audio; they do not ignore the assets and continue generation.
  • first_last_frames accepts only 0–2 images (numbered 1/2) and cannot mix in reference videos/audio.

Generation-side parameters unsupported by yaoshu-video: seed / watermark / reference_options; they are rejected explicitly.

Top-level parameters:

ParameterMeaningTypeRequiredUsage and default
modelModel namestringYesAlways yaoshu-video
contentArray of text and asset contentarrayOne of twoPut the prompt and the images/videos/audio in a single array; mutually exclusive with the top-level prompt
promptVideo promptstringOne of twoDescribe people, scene, actions, camera work, and sound; reference assets with @image_file_1, @video_file_1, @audio_file_1
durationOutput video durationintNoIn seconds, 4–30, default 5 seconds; this is not the reference video duration. The special value -1 is treated as the default 5 seconds and does not mean the duration is decided automatically; any other out-of-range value returns 400 invalid_request
ratioFrame aspect ratiostringNoDefault 9:16 (portrait); 16:9 (landscape), 1:1 (square), 4:3, 3:4, 21:9 (ultra-wide landscape); auto lets the service choose the framing based on the request
resolutionOutput definitionstringNo480p / 720p, default 720p. This is not the aspect ratio; it controls definition while ratio controls frame shape, and the selected tier participates in billing
functionModeVideo generation modestringNoomni_reference = multi-asset reference mode (default; also used for text-only and single-image generation); first_last_frames = first/last frame mode. See the mode descriptions below
generate_audioGenerate a video with soundbooleanNoDefault true: generate sound matching the picture; false: generate a silent video. See the sound control description below
image_file_1…image_file_30Reference imagestring / file (URL or file)NoProvides reference for character appearance, object, scene, or style; pass an http(s) URL in JSON, or a URL or file in multipart
video_file_1…video_file_10Reference videostring / file (URL or file)NoProvides reference for motion, expression, camera movement, or pacing; MP4/MOV, 2–30 seconds per clip, at most 50MiB each, at most 30 seconds in total; the reference duration participates in billing
audio_file_1…audio_file_10Reference audiostring / file (URL or file)NoProvides reference for voice, melody, or rhythm; it does not enable output sound — output sound is controlled by generate_audio. For format, size, and duration limits, see "Asset Preparation Requirements"
callback_urlTask result notification URLstringNoReceives an HTTP POST notification when the task succeeds or fails; must be HTTPS, a non-HTTPS value returns 400; optional — you can poll instead

Sound Control: With or Without Audio ​

generate_audio controls whether the output video carries sound; you do not need to upload audio separately to get a video with sound.

ValueMeaningOutput and usage
true (default)Generate a video with soundGenerates sound matching the prompt and picture; you can describe character dialogue, ambient sound, action sound effects, and background music in the prompt; this does not mean every video contains all of them
falseGenerate a silent videoThe output carries no sound, which suits adding your own voiceover or music afterwards; even if the prompt contains dialogue, audio is not turned on because of it

When you need dialogue, state the character, language, tone, and line clearly, and put the line in double quotes, for example: The man turns his head and says calmly in Mandarin: "See you tomorrow.". Escape English double quotes inside a JSON string as \"; curly double quotes “See you tomorrow.” also work.

When you need "dialogue but no background music", keep generate_audio=true and write in the prompt "keep only character dialogue and ambient sound, no background music". false turns off all sound and cannot be used to disable only the music. Prompts guide the creation; they do not guarantee that the dialogue is word-for-word, that lip sync matches, or that sound details are identical every time.

Generation Modes: Multi-Asset Reference and First/Last Frames ​

English valueMeaningSuitable scenarios
omni_referenceMulti-asset reference mode (default)With no assets, generate from text; with a single image, reference that image; with multiple assets, explain one by one in the prompt which part of the character, scene, action, or sound each one references
first_last_framesFirst/last frame modeSpecify the opening and closing frames of the video and describe how it changes in between; image slot 1 is the first frame and slot 2 the last frame; do not mix in video or audio assets

role inside content expresses "asset purpose": reference_image = reference image, reference_video = reference video, reference_audio = reference audio, first_frame = first frame, last_frame = last frame. A normal reference image guides appearance or style, which is different from explicitly designating the first and last frames; writing only "this is the first frame" in the prompt does not switch the request to first/last frame mode.

When functionMode is omitted, if the JSON content contains a first_frame or last_frame role, the API automatically uses first_last_frames; without a first/last frame role it defaults to omni_reference. Declaring the mode explicitly is recommended, so the request is easier to verify.

Writing the Prompt ​

Organize the prompt as asset roles → subject and scene → action and camera → timing → sound requirements; there is no need to pile up terminology:

  • Asset roles: state clearly whether @image_file_1 provides a character's appearance, whether @video_file_1 references action or camera movement, and whether @audio_file_1 references voice or rhythm. With multiple characters, bind each image and voice one by one; do not only write character names on the asset images.
  • Action and camera: first write who does what and where, then close shot, extreme close-up, slow push-in, and so on; describe actions in order and avoid contradictory requirements.
  • Timing: you may write "0–3 seconds… 3–5 seconds…"; keep the segments continuous and consistent with duration. Do not cram too much plot into a short video; the prompt timeline guides the creation and does not guarantee that actions happen strictly at the specified millisecond.
  • Sound requirements: who speaks, what is said, in which language and with which emotion; describe background music and ambient sound separately. Set generate_audio=false when you need complete silence.
  • Subtitles and on-screen text: you may write "no subtitles", but complete removal is not guaranteed every time; prefer reference assets without subtitles. When text must be displayed accurately, you can render the correct text into a reference image, and you should still check the glyphs after generation.

Below is a prompt example for a 5-second scene with sound. Put it into prompt and set duration=5 and generate_audio=true; for the rest of the request format, see the text-only generation example below.

text
Realistic cinematic style, a street-side café at dusk.
0–3 seconds: medium shot, two friends stand up to say goodbye, the camera slowly pushes in.
3–5 seconds: the man turns his head, smiles, and says in Mandarin: "See you tomorrow." The woman nods in reply.
Sound: keep only this line of dialogue, light footsteps, and street ambience; no background music.
Visuals: no subtitles.

The fields and allowed values on this page are the basis for integration. Editing, extension, and sample-clip workflows from other video service tutorials, together with their dedicated parameters, cannot be treated as capabilities of this API; do not add omni_reference_task_type, output_format, or draft on your own, and do not write the aspect ratio as adaptive.

Text-Only Generation ​

This example needs no reference assets. A successful submission creates a generation task and is billed according to platform rules.

bash
curl https://token.yaoshu.cc/api/v3/contents/generations/tasks \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "yaoshu-video",
    "prompt": "An orange tabby cat running across a grassy field, slow motion, sunset light",
    "duration": 5,
    "ratio": "16:9",
    "resolution": "720p",
    "functionMode": "omni_reference",
    "generate_audio": true
  }'

First/Last Frame Generation ​

Use two images as the first frame and the last frame respectively. The example.com addresses below only indicate the field positions and must be replaced with directly downloadable addresses that meet the asset requirements. First/last frame roles conflict with functionMode=omni_reference; the two cannot be used together.

bash
curl https://token.yaoshu.cc/api/v3/contents/generations/tasks \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "yaoshu-video",
    "content": [
      { "type": "text", "text": "Smoothly transition from the opening frame to the closing frame" },
      { "type": "image_url", "role": "first_frame", "image_url": { "url": "https://example.com/first.jpg" } },
      { "type": "image_url", "role": "last_frame", "image_url": { "url": "https://example.com/last.jpg" } }
    ],
    "functionMode": "first_last_frames",
    "duration": 5,
    "resolution": "720p",
    "ratio": "16:9"
  }'

first_frame maps to image_file_1 and last_frame maps to image_file_2; each role accepts at most one image and cannot be mixed with normal reference images, reference videos, or reference audio. first_last_frames accepts 0–2 images per request, and the current service route may require exactly two; provide two images when you need explicit first/last frame control, and prefer omni_reference for generation with zero or one image.

JSON Multi-Asset Reference ​

The numbered fields can be referenced directly in the prompt:

json
{
  "model": "yaoshu-video",
  "prompt": "Reference the character from @image_file_1, the motion from @video_file_1, and the rhythm from @audio_file_1",
  "functionMode": "omni_reference",
  "duration": 5,
  "resolution": "720p",
  "ratio": "16:9",
  "generate_audio": false,
  "image_file_1": "https://example.com/hero.jpg",
  "video_file_1": "https://example.com/motion.mp4",
  "audio_file_1": "https://example.com/music.mp3"
}

You can also use the content array; in that case remove the top-level prompt and the numbered asset fields and use the following content, keeping the other specification parameters unchanged. Normal assets are numbered within their own type in order of appearance: the first reference image is image_file_1, the first reference video is video_file_1, and the first reference audio is audio_file_1. Multiple text entries are merged with line breaks.

json
{
  "model": "yaoshu-video",
  "content": [
    { "type": "text", "text": "Reference the character from @image_file_1, the motion from @video_file_1, and the rhythm from @audio_file_1" },
    { "type": "image_url", "role": "reference_image", "image_url": { "url": "https://example.com/hero.jpg" } },
    { "type": "video_url", "role": "reference_video", "video_url": { "url": "https://example.com/motion.mp4" } },
    { "type": "audio_url", "role": "reference_audio", "audio_url": { "url": "https://example.com/music.mp3" } }
  ],
  "functionMode": "omni_reference",
  "duration": 5,
  "resolution": "720p",
  "ratio": "16:9",
  "generate_audio": false
}

Successful response (HTTP 202):

json
{ "id": "task_El8gSN85K39z", "task_id": "task_El8gSN85K39z", "status": "queued" }

Idempotent Submission ​

A create request may carry a single Idempotency-Key request header (1–64 bytes UTF-8) — replaying the same Key with the same request body for the same user returns the previous response (including a recorded failure response); the same Key with a different request body returns 409 idempotency_conflict; while the request is being processed it returns 409 idempotency_in_progress. When retrying the same business request after a network timeout, reuse the Key and the original request content; when you deliberately start another generation task, use a new Key. Do not blindly retry a request whose outcome is still unknown by switching Keys, to avoid duplicate generation and billing.

Multi-Asset and Local Files ​

bash
curl https://token.yaoshu.cc/api/v3/contents/generations/tasks \
  -H "Authorization: Bearer sk-your-api-key" \
  -F "model=yaoshu-video" \
  --form-string 'prompt=Reference the character from @image_file_1, the motion from @video_file_1, and the rhythm from @audio_file_1' \
  -F "functionMode=omni_reference" \
  -F "duration=5" -F "resolution=480p" -F "ratio=16:9" \
  -F "generate_audio=false" \
  -F "image_file_1=@./hero.jpg" \
  -F "video_file_1=@./motion.mp4" \
  -F "audio_file_1=@./music.mp3"

Use --form-string when the prompt contains @, so that curl does not interpret it as a file. Explicit asset numbering stays stable; the same URL placed under different numbers still counts as different assets. Multipart first/last frame requests use prompt + functionMode=first_last_frames + image_file_1/2. The content array and its first_frame / last_frame roles apply to JSON requests; do not pass a JSON string through -F 'content=[...]' in place of the array.

2. Polling a Task ​

bash
curl https://token.yaoshu.cc/api/v3/contents/generations/tasks/{task_id} \
  -H "Authorization: Bearer sk-your-api-key"
FieldDescription
id / task_idTask ID (both have the same value)
modelPlatform task model identifier; requests on this page use yaoshu-video, and callers do not need to specify any other execution model
statusqueued (queued) → running (generating) → succeeded / failed / cancelled / expired
progressCompletion percentage 0–100
content.video_urlDownload URL of the video once succeeded: either a complete direct link that can be downloaded immediately, or a platform proxy address (only when the artifact must be fetched with platform credentials). In both cases request the returned value as-is; do not rewrite it
duration / ratioOutput video duration (seconds) / frame aspect ratio; returned when present in the task record
errorReason for failure, cancellation, or expiry (message / type / code)
created_at / updated_atSubmission / update timestamps

Successful task query example:

json
{
  "id": "task_example",
  "task_id": "task_example",
  "model": "yaoshu-video",
  "status": "succeeded",
  "progress": 100,
  "duration": 5,
  "ratio": "16:9",
  "content": { "video_url": "/v1/videos/task_example/content" },
  "created_at": 1792149394,
  "updated_at": 1792149607
}

Poll every 5–10 seconds and stop polling once a terminal state is reached. Timestamps are in Unix seconds. A terminal state does not mean the download URL stays valid forever; error is returned only in the failed, cancelled, or expired state. The current API provides no operation to delete or actively cancel a task; DELETE returns 400 task_delete_not_supported.

Task List and Filtering ​

The list returns only tasks belonging to the user who owns the current API Key, covering the last 7 days, ordered by task record ID descending. page_num defaults to 1 and ranges from 1 to 100000; page_size defaults to 20 and ranges from 1 to 100, and out-of-range values are clamped into range. New tasks may be inserted between pages; to track a particular task, save the ID returned by submission and use the single-task query.

Query parameterDescription
page_num / page_sizePage number / page size
filter.modelExact model name; this page uses yaoshu-video
filter.statusStatus value; repeat the same parameter for multiple values, and tasks matching any of them are returned
filter.task_idsAt most 100 task IDs; repeat the same parameter for multiple IDs instead of joining them with commas
bash
curl --get https://token.yaoshu.cc/api/v3/contents/generations/tasks \
  -H "Authorization: Bearer sk-your-api-key" \
  --data-urlencode "page_num=1" \
  --data-urlencode "page_size=20" \
  --data-urlencode "filter.model=yaoshu-video" \
  --data-urlencode "filter.status=succeeded" \
  --data-urlencode "filter.status=failed" \
  --data-urlencode "filter.task_ids=task_example_a" \
  --data-urlencode "filter.task_ids=task_example_b"

Filter conditions of different types apply together; the example above looks for the two specified tasks that belong to yaoshu-video and whose status is succeeded or failed. In the response, data and items are the same page of tasks with identical content; task objects are the same as in the single-task query. total is the number of tasks in the last 7 days that match all filter conditions.

json
{
  "data": [],
  "items": [],
  "page_num": 1,
  "page_size": 20,
  "total": 0
}

3. Downloading the Video Artifact ​

Once the query returns succeeded, download with content.video_url as-is:

bash
curl -o video.mp4 "<content.video_url as returned>" \
  -H "Authorization: Bearer sk-your-api-key"
  • content.video_url is a complete direct link (server storage address) that you can request directly; only when it points to a platform proxy address do you need to carry the API Key (retrieving that address requires platform-side credentials)
  • Direct links have a retention period (determined by the storage provider, possibly only a few hours) and return 404/410 after it expires
  • The platform does not cache, copy, or extend the retention period: once expired, the artifact cannot be fetched again — download it immediately after the task succeeds and store it in your own storage
  • Platform proxy addresses support Range requests: no range returns 200 with the full body, a single range returns 206 plus Content-Range, and an out-of-range request returns 416
  • When the artifact can no longer be fetched, the response is 410 video_result_expired; a task that does not exist returns 404. A task query showing succeeded does not mean the artifact is still downloadable at that moment

4. Billing ​

Video is billed by billed seconds × tier unit price, and the unit price is defined on the model pricing page in the Console. Without reference video, the billed seconds equal the output duration; with reference video, the billed seconds are output seconds + the actual total duration of all reference videos rounded up. For example, with a 5-second output and reference videos of 2.2 seconds + 2.2 seconds, the 4.4-second reference total rounds up to 5 seconds, so 10 seconds are billed; rounding is not applied per clip. Images/audio do not add video seconds under this rule.

Tier determination: yaoshu-video offers 480p / 720p; when unspecified, 720p is used. The equivalent resolution value "1280x720" is normalized to 720p, but standalone size / width / height fields are not accepted. Always use the standard 480p / 720p tiers. An invalid tier returns 400 invalid_request. When a reference video cannot be downloaded or its actual duration cannot be read, the request is rejected rather than submitted for generation as 0 seconds; the reference video URL must return the body directly and must not rely on HTTP redirects.

When a generation result lacks a valid artifact URL, the task is treated as failed; an artifact that expires after success, or a download that temporarily fails, does not automatically turn a successful task into a failed one. Charges already paid for a failed task are refunded against the original payment record; refunds are retried on temporary errors, so the failed task state and the refund arrival time may differ. When historical payment evidence is incomplete or a refund trace already exists, manual review is required, and you cannot determine that a refund has arrived from the failed status alone.

5. Task Callback ​

You may optionally provide callback_url at submission, set to an HTTPS address that the caller can reach from the public internet. Once the task reaches a terminal state, the platform sends a JSON POST to that address; the callback receiver returns any 2xx to indicate successful receipt. Network errors, timeouts, or non-2xx responses trigger retries, so the receiver must deduplicate by event ID and respond quickly after reliably storing the notification.

Successful notification example:

json
{
  "id": "evt_example",
  "type": "video.task.succeeded",
  "created_at": 1792149607,
  "data": {
    "id": "task_example",
    "task_id": "task_example",
    "status": "succeeded",
    "content": { "video_url": "/v1/videos/task_example/content" }
  }
}

Full failure notification example (the outer type is the event type, data.error.type is the error type; there is no data.content on failure):

json
{
  "id": "evt_example",
  "type": "video.task.failed",
  "created_at": 1792149607,
  "data": {
    "id": "task_example",
    "task_id": "task_example",
    "status": "failed",
    "error": {
      "message": "Specific reason the video generation failed",
      "type": "video_generation_failed",
      "code": "video_generation_failed"
    }
  }
}

data.status may also be expired or cancelled, with the corresponding event types video.task.expired / video.task.cancelled. The video address in the callback is a relative path and must be resolved against the platform site used for the generation request and downloaded with the API Key. created_at is the Unix-seconds timestamp of this notification attempt and may change on retries; the same event ID stays unchanged.

Signature Verification ​

The platform sends the following request headers (the names are fixed protocol fields):

HeaderContent
X-New-Api-Event-IdEvent ID, identical to the top-level id in the JSON
X-New-Api-Task-IdTask ID, identical to data.task_id
X-New-Api-TimestampTimestamp of this notification, Unix seconds
X-New-Api-Signaturev1= followed by a 64-character lowercase hexadecimal signature

The verification key is the complete API Key (including sk-) used to submit the task — not the Bearer prefix, and not another key of the same user. First derive a 32-byte key with HKDF-SHA256: the salt is 32 zero bytes and the info is the UTF-8 string new-api-video-callback-v1. Then compute HMAC-SHA256 over timestamp + newline + event ID + newline + raw request body with the derived key. The raw request body must keep the bytes exactly as received; do not parse the JSON and re-serialize it.

The following Node.js example only performs local signature verification; it does not call the generation API:

javascript
import { hkdfSync, createHmac, timingSafeEqual } from 'node:crypto';

export function verifyVideoCallback(apiKey, headers, rawBody) {
  const eventId = headers['x-new-api-event-id'];
  const timestamp = headers['x-new-api-timestamp'];
  const supplied = headers['x-new-api-signature'];
  if (typeof eventId !== 'string' || !/^\d+$/.test(timestamp ?? '') ||
      typeof supplied !== 'string' || !/^v1=[a-f0-9]{64}$/.test(supplied)) return false;
  // Callback retries use a new timestamp; the receiving server should keep its clock in sync.
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
  const key = Buffer.from(hkdfSync('sha256', Buffer.from(apiKey, 'utf8'),
    Buffer.alloc(32), Buffer.from('new-api-video-callback-v1', 'utf8'), 32));
  const expected = createHmac('sha256', key)
    .update(`${timestamp}\n${eventId}\n`, 'utf8').update(rawBody).digest();
  return timingSafeEqual(expected, Buffer.from(supplied.slice(3), 'hex'));
}

After verification passes, parse the JSON, check that the header event ID / task ID match the body, and then handle the notification idempotently by event ID. Do not write the API Key into logs. Retry intervals are 30, 60, 120, 240, 480, 960, and 1920 seconds, then every 3600 seconds thereafter; scheduling time also has an effect, so these are not exact arrival times. There is currently no fixed maximum retry count commitment. When the callback is unreachable, you can still poll the result with the task ID.

6. Error Handling ​

JSON error responses from video endpoints use an error object rather than the management API response wrapper. The 416 from the download endpoint may have an empty body, so it should not be parsed as JSON unconditionally; Content-Range may also be missing. Example:

json
{
  "error": {
    "message": "Video task not found",
    "type": "task_not_found",
    "code": "task_not_found"
  }
}
ScenarioHTTP / error identifierCaller handling
Invalid parameters, assets, or mode400, usually invalid_request; unsupported fields may also be unsupported_video_parameterFix the request based on message; do not retry it unchanged
Querying a task that does not exist or does not belong to the current user404 task_not_foundCheck the task ID and the user that owns the key
Idempotency Key content conflict / request in progress409 idempotency_conflict / idempotency_in_progressOn conflict, check the business request; while in progress, retry later with the same Key
Video artifact can no longer be fetched410 video_result_expiredDo not repeatedly retry an expired artifact; use the copy you have stored
Download byte range not satisfiable416Correct or remove Range; read the total length from Content-Range when present, and do not rely on that header to recover the download when it is missing

Authentication failures, insufficient quota, no available service route, and other precondition errors follow the platform's general error rules; see API Integration Overview. A 202 from task submission only means the request was accepted — keep querying until a terminal state; only succeeded together with a successful download means the artifact has been delivered to the caller.

Public documentation for platform users