Create video generation task
Submit a video generation task; returns a task ID immediately. Video generation is an async operation --
poll task status via GET /v1/videos/generations/{taskId}.
Billing: estimated amount is frozen at submission based on duration; settled by actual usage on success. Frozen amount is refunded on failure.
Supports multiple input modes (specified via the content array):
- Text-to-video: Only pass a
type: textprompt - Image-to-video (first frame / first+last frame): Pass images with
roleset tofirst_frame/last_frame - Multi-modal reference video (Seedance 2.0 / MiniMax-H3): reference images, videos, and audio
- Audio-enabled video (Seedance 2.0, 1.5 pro): Set
generate_audio: true. MiniMax-H3 does not support this field. - Draft mode (Seedance 2.5 only):
draft: truefirst renders a 480p preview, billed the same as a normal 480p video. After review, submit again with only adraft_taskitem incontentand the returned task ID to render the 1080p final video. Do not resend the prompt, references, duration, aspect ratio, seed, orgenerate_audio. The two steps are billed separately. The final video's price follows whether the draft step included a reference video; the draft itself is not an input video. The draft task ID is valid for 7 days. Idle models do not support this.
MiniMax-H3 (China / international): see "MiniMax H3 request parameters". resolution is 768P or 2K, duration is an integer 4–15, text-to-video requires a concrete ratio, and first/last frames cannot mix with reference assets.
Image / media reference rules (important):
- Regular images:
image_url.urlmust be a publicly reachable https URL (object storage / CDN). The upstream engine fetches the URL directly; the proxy does not buffer the image. - Reference images that contain real people: must use
asset://<asset_id>, pointing to a verified real-person asset. Complete the H5 liveness verification flow viaPOST /v1/asset-groups/validate-sessionfirst to obtain agroup_id/asset_id. Passing a real-person image as a URL or inline base64 will be rejected upstream withInputImageSensitiveContentDetected.PrivacyInformation. - Do not inline base64:
data:image/...;base64,...data URIs bloat the request body to MB scale. The request body is hard-capped at 5 MB; exceeding it returns413 payload_too_large. Upload to object storage and pass a URL, or useasset://from the asset library.
Set video_url_mode to upstream to receive the native output without waiting for archiving, auto to permit a saved-copy fallback, or tos to wait for a verified archive. Omitting it preserves the account default. This setting applies to the new task and its callbacks; it does not disable background saving. Native expiry may be unknown, and idle enhanced models reject upstream.
To combine an explicit mode with callback_url, configure the account Webhook Secret first; otherwise creation returns 400 webhook_secret_required. Existing callbacks without a secret keep their previous provider delivery path when the mode is omitted.
Authorization
BearerAuth API key authentication (OpenAI format). Pass in the Authorization header:
Authorization: Bearer tr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X post "https://api.xrtoken.ai/v1/videos/generations" \ -H "Content-Type: application/json" \ -d '{ "model": "volcengine/doubao-seedance-2-0-260128", "content": [ { "type": "text", "text": "A cat running on the grass, cinematic, slow motion" } ], "resolution": "720p", "duration": 5 }'{
"id": "550e8400-e29b-41d4-a716-446655440000",
"upstream_id": "string",
"model": "string",
"status": "queued",
"created_at": "2019-08-24T14:15:22Z"
}{
"error": "model field is required",
"type": "invalid_request_error"
}{
"error": "invalid or missing API key",
"type": "auth_error"
}{
"error": "insufficient balance -- please top up or upgrade your plan",
"type": "billing_error"
}{
"error": "rate limit exceeded",
"type": "rate_limit_error"
}{
"error": "upstream provider error",
"type": "server_error"
}