Skip to content
API Reference · Video Generation API

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 models
  • POST https://api.alltoken.ai/v1/videos/generations — create a generation task
  • GET https://api.alltoken.ai/v1/videos/generations/{id} — poll task status
  • GET https://api.alltoken.ai/v1/videos/generations — list tasks
  • POST https://api.alltoken.ai/v1/videos/generations/{id}/cancel — cancel a task

List Video Models

GET
$GET https://api.alltoken.ai/v1/videos/models

Returns all available video generation models in OpenAI-compatible format.

Response JSON
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
$POST https://api.alltoken.ai/v1/videos/generations

Text-to-video:

Request body JSON
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):

Request body JSON
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):

Response JSON
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 video
  • content — Multimodal input array (image-to-video or video reference). Each item has type (image_url / video_url / audio_url / draft_task) and role (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 / adaptive
  • duration — Duration in seconds; -1 for model-decided
  • resolution480p / 720p / 1080p
  • frames - Frame count (takes precedence over duration)
  • generate_audio - Generate matching audio track
  • input_has_video - Set when the input content includes a video reference
  • seed - Random seed for reproducibility
  • camera_fixed — Lock the camera
  • watermark — Add watermark (default false)
  • callback_url — URL called when the task completes
  • return_last_frame — Return last-frame URL (for continuation)
  • service_tierdefault / flex
  • execution_expires_after — Execution expiry window in seconds (3600-259200)
  • draft — Create or use a draft task when supported
  • tools — Optional tool configuration, such as web_search
  • safety_identifier — Optional stable safety identifier, up to 64 characters

Get Task Status

GET
$GET https://api.alltoken.ai/v1/videos/generations/{id}

Returns task details. When status is completed, video_url is the download URL.

Response JSON
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 GPU
  • processing — Model is generating
  • completed — Done, video_url available
  • failed — Generation failed; details in error
  • expired - Task or generated asset expired
  • cancelled — 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
$GET https://api.alltoken.ai/v1/videos/generations?limit=20&status=completed

Paginated 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
$POST https://api.alltoken.ai/v1/videos/generations/{id}/cancel

Cancels 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 key
  • 402 — Insufficient balance
  • 404 — Task ID not found
  • 409 — Task state does not allow this action (e.g. cancel a completed task)
  • 429 — Rate limit exceeded