Video Generation API
Asynchronous video generation — create, poll, list, cancel. Supports text-to-video and image-to-video.
Overview
Video generation is an asynchronous task: POST /videos/generations returns a task ID immediately, then poll GET /videos/generations/{id} until status becomes completed, then read video_url to download the result.
Supported models: seedance-1.5-pro, seedance-2.0, etc. Use GET /videos/models for the live list. Full schema and constraints in the interactive API explorer.
GET https://api.alltoken.ai/v1/videos/models— list available video modelsPOST https://api.alltoken.ai/v1/videos/generations— create a generation taskGET https://api.alltoken.ai/v1/videos/generations/{id}— poll task statusGET https://api.alltoken.ai/v1/videos/generations— list tasksPOST https://api.alltoken.ai/v1/videos/generations/{id}/cancel— cancel a task
List Video Models
$GET https://api.alltoken.ai/v1/videos/modelsReturns all available video generation models in OpenAI-compatible format.
| 1 | { |
| 2 | "object": "list", |
| 3 | "data": [ |
| 4 | { "id": "seedance-1.5-pro", "object": "model", "owned_by": "chat" }, |
| 5 | { "id": "seedance-2.0", "object": "model", "owned_by": "chat" } |
| 6 | ] |
| 7 | } |
Create a Video Generation Task
$POST https://api.alltoken.ai/v1/videos/generationsText-to-video:
| 1 | { |
| 2 | "model": "seedance-1.5-pro", |
| 3 | "prompt": "A cat surfing on a rainbow", |
| 4 | "duration": 5, |
| 5 | "ratio": "16:9", |
| 6 | "resolution": "720p" |
| 7 | } |
Image-to-video (first-frame guidance):
| 1 | { |
| 2 | "model": "seedance-1.5-pro", |
| 3 | "prompt": "The cat jumps forward", |
| 4 | "content": [ |
| 5 | { |
| 6 | "type": "image_url", |
| 7 | "image_url": { "url": "https://example.com/cat.png" }, |
| 8 | "role": "first_frame" |
| 9 | } |
| 10 | ], |
| 11 | "duration": 5 |
| 12 | } |
Response (task created, status queued):
| 1 | { |
| 2 | "id": "vgen_01abc", |
| 3 | "status": "queued", |
| 4 | "model": "seedance-1.5-pro", |
| 5 | "input_type": "text", |
| 6 | "ratio": "16:9", |
| 7 | "resolution": "720p", |
| 8 | "duration": 5, |
| 9 | "created_at": "2026-04-27T10:00:00Z" |
| 10 | } |
Request Parameters
model(required) — Video model ID (e.g."seedance-1.5-pro")prompt(required) — Text description of the desired videocontent— Multimodal input array (image-to-video or video reference). Each item hastype(image_url/video_url/audio_url/draft_task) androle(first_frame/last_frame/reference_image/reference_video/reference_audio)ratio— Aspect ratio:16:9/9:16/4:3/3:4/21:9/1:1/adaptiveduration— Duration in seconds;-1for model-decidedresolution—480p/720p/1080pframes- Frame count (takes precedence overduration)generate_audio- Generate matching audio trackinput_has_video- Set when the input content includes a video referenceseed- Random seed for reproducibilitycamera_fixed— Lock the camerawatermark— Add watermark (defaultfalse)callback_url— URL called when the task completesreturn_last_frame— Return last-frame URL (for continuation)service_tier—default/flexexecution_expires_after— Execution expiry window in seconds (3600-259200)draft— Create or use a draft task when supportedtools— Optional tool configuration, such asweb_searchsafety_identifier— Optional stable safety identifier, up to 64 characters
Get Task Status
$GET https://api.alltoken.ai/v1/videos/generations/{id}Returns task details. When status is completed, video_url is the download URL.
| 1 | { |
| 2 | "id": "vgen_01abc", |
| 3 | "status": "completed", |
| 4 | "model": "seedance-1.5-pro", |
| 5 | "video_url": "https://cdn.example.com/videos/vgen_01abc.mp4", |
| 6 | "video_url_expires_at": "2026-04-27T11:00:00Z", |
| 7 | "video_url_ttl": 3600, |
| 8 | "duration": 5, |
| 9 | "fps": 24, |
| 10 | "resolution": "720p", |
| 11 | "ratio": "16:9", |
| 12 | "usage": { |
| 13 | "completion_tokens": 256, |
| 14 | "total_tokens": 256 |
| 15 | }, |
| 16 | "created_at": "2026-04-27T10:00:00Z", |
| 17 | "completed_at": "2026-04-27T10:01:32Z" |
| 18 | } |
video_url is a presigned URL that expires after video_url_ttl seconds. Re-call this endpoint to refresh the URL.
Task Status Values
queued— Enqueued, waiting for GPUprocessing— Model is generatingcompleted— Done,video_urlavailablefailed— Generation failed; details inerrorexpired- Task or generated asset expiredcancelled— Cancelled by the user
Recommended polling interval: 2-5 seconds. Most tasks complete in 30-120 s; high-resolution jobs may take 3-5 minutes.
List Tasks
$GET https://api.alltoken.ai/v1/videos/generations?limit=20&status=completedPaginated list of the current user's video generation tasks. Query parameters:
limit— Page size (default 20, max 100)status— Filter by status (queued/processing/completed/failed/expired/cancelled)
Cancel a Task
$POST https://api.alltoken.ai/v1/videos/generations/{id}/cancelCancels a task that has not yet completed (queued or processing only). Already completed / cancelled tasks return 409 Conflict.
Error Responses
400— Bad request (e.g. empty prompt, invalid ratio)401— Invalid or missing API key402— Insufficient balance404— Task ID not found409— Task state does not allow this action (e.g. cancel a completed task)429— Rate limit exceeded