Video Generation
Video generation is an asynchronous task: create a task to get a taskId, poll for the result, and receive the video URL when done. Both text-to-video and image-to-video (with reference images) are supported.
1. Create a Task#
POST https://api.smartapi.cc/api/openapi/v1/generate/video/tasksAuthorization: Bearer sk-your-key-here
Content-Type: application/jsonRequest Body#
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model id, e.g. wan2.5, veo3.1. |
prompt | string | Yes | Text prompt. |
duration | integer | No | Duration in seconds (per model’s supported values, e.g. 5/10/15). |
resolution | string | No | Resolution, e.g. 480P / 720P / 1080P. |
ratio | string | No | Aspect ratio, e.g. 16:9 / 9:16. |
seed | integer | No | Random seed. |
referenceImageUrls | array | No | Reference image URLs (image-to-video). |
generateAudio | boolean | No | Whether to generate audio (model-dependent; affects billing). |
Supported durations, resolutions, ratios, and audio support can be viewed as a list in the “Image/Video Call Rules” tab on the Models page, or in the Playground form.
curl https://api.smartapi.cc/api/openapi/v1/generate/video/tasks \
-H "Authorization: Bearer $SMARTAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.5",
"prompt": "Waves crashing on rocks, slow motion, dusk",
"duration": 5,
"resolution": "720P"
}'Response#
{ "taskId": "task_abc123", "status": "processing" }2. Query Task Result#
Poll every 5 seconds until a terminal status. Pass model as a query parameter.
GET https://api.smartapi.cc/api/openapi/v1/generate/video/tasks/{taskId}?model=wan2.5{
"taskId": "task_abc123",
"status": "succeeded",
"videoUrl": "https://.../result.mp4"
}Status is normalized to: submitted / processing (in progress); succeeded (or a returned videoUrl) success; failed; canceled.
3. Cancel a Task#
POST https://api.smartapi.cc/api/openapi/v1/generate/video/tasks/{taskId}/cancel{ "taskId": "task_abc123", "cancelled": true }If you don’t want to poll manually, the Task Records page shows the status, progress and results of all image/video tasks, with online preview and download.
Billing#
Video models are billed in credits (not tokens), and billing happens when the task is created successfully. Common formulas:
PER_SECOND: total = credits-per-second × duration.PER_SECOND_RESOLUTION: total = credits-per-second × duration × resolution multiplier.- If
generateAudiois enabled and the model configures an audio multiplier, the result is multiplied again.
See per-model prices and resolution multipliers in the Models page and the Billing doc for details.