Overview
AI tasks such as video generation, image generation, and music generation can take anywhere from tens of seconds to several minutes. To ensure a good user experience and system stability, these tasks are handled through an async task API:- Submit a task — Send a generation request and immediately receive a task ID
- Poll for status — Use the task ID to check progress, or receive a callback notification
- Retrieve results — Once complete, get the generated resource URLs from the response
Supported Models
| Provider | Example Models | Type |
|---|---|---|
| Kling | kling-v2, kling-v1-6 | Video / Image |
| Luma | luma-ray-2, luma-photon | Video |
| Runway | runway-gen4 | Video |
| RunwayML | runwayml-gen3a-turbo | Video |
| Veo (Google) | veo-3 | Video |
| Minimax | minimax-video-01 | Video |
| Vidu | vidu-2.0 | Video |
| Jimeng | jimeng-v2 | Video / Image |
| Doubao (VolcEngine) | doubao-seedance-1-0-pro | Video |
| Flux (BFL) | flux-pro, flux-kontext-pro | Image |
| Replicate | replicate/* | Image / Video |
| Xai (Grok) | grok-2-image | Video |
| Ali (Alibaba) | wanx-v2 | Image / Video |
input parameters vary by model — click on any model in the list to view its detailed documentation.
Submit a Task
POST /v1/task/submit
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model name |
| input | object | Yes | Model-specific generation parameters |
| callback_url | string | No | Webhook URL for task status updates |
Request Examples
Response Example
Query a Task
GET /v1/task/{task_id}
Request Examples
Response Examples
Task in progress:Task Statuses
| Status | Description |
|---|---|
| queued | Task submitted, waiting to be processed |
| in_progress | Task is currently being generated |
| completed | Task finished — results available in outputs |
| failed | Task failed — reason available in error |
Callback Notifications
When you include acallback_url in your submit request, the system will send a POST request to that URL whenever the task status changes. The callback body uses the same format as the query response:
Complete Polling Example
Response Fields
| Field | Type | Description |
|---|---|---|
| id | string | Unique task identifier |
| status | string | Task status: queued / in_progress / completed / failed |
| created_at | integer | Task creation time (Unix timestamp in seconds) |
| completed_at | integer | Task completion time (Unix timestamp in seconds), only present when completed or failed |
| outputs | string[] | List of result URLs (video/image/audio), only present when completed |
| error | string | Error message, only present when failed |
Notes
- Authentication uses standard
Authorization: Bearer <API_KEY>headers - The
inputparameters vary by model — click on the model in the Models page to view its documentation - Recommended polling interval is 3–10 seconds to avoid excessive requests
- Resource URLs in task results may have expiration limits — download and save promptly
Related Links
Video Models
Provider-specific video generation API documentation
Image Models
Image generation API documentation