Video Generation API
This page describes the workflow for creating and downloading videos via the /videos endpoint, covering complete examples for text-to-video, image-to-video, video continuation, audio-driven generation, status polling, and content download. Examples use requests/curl and can be replaced with any other HTTP client.
For available models, pricing, and regions, refer to the model list:
Authentication & Base Information
- Base URL:
https://live-turing.cn.llm.tcljd.com/api/v1 - Authentication:
Authorization: Bearer <YOUR_API_KEY> - Resource paths:
- Create task:
POST /videos - Query status:
GET /videos/{video_id} - Download content:
GET /videos/{video_id}/content
- Create task:
- Common
statusvalues:queued→processing→completed;failedon error.
Parameter Constraints
Veo Models
- seconds (string): Only
"4","6", or"8"are supported. - size (string): Only
"1280x720"and"720x1280"are supported. - input_reference: Reference image uploaded for image-to-video; file size limit is 10 MB.
- personGeneration (string): Supported only by Gemini Veo models. When uploading a portrait image (including faces) for image-to-video, pass
allow_allto permit video generation based on that image.
Seedance Models
For the full Seedance API parameter specification, refer to the Volcano Engine official documentation.
Seedance parameters: Pass Seedance native parameters directly in the JSON body for richer control:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | Model ID |
prompt | string | Yes | - | Text description (automatically inserted into the content array) |
content | array | No | [] | Multimodal content array; supports mixed text/image/video/audio (see below) |
resolution | string | No | - | Resolution: "480p", "720p" |
ratio | string | No | - | Aspect ratio: "16:9", "9:16", "1:1", "4:3", "3:4" |
duration | int | No | - | Video duration in seconds: 4, 5, 6, 8 |
seed | int | No | - | Random seed for reproducibility |
watermark | bool | No | false | Whether to add a watermark |
generate_audio | bool | No | true | Whether to generate audio |
return_last_frame | bool | No | false | Whether to return the last frame as an image (useful for video continuation) |
Supported types in the content array:
| type | Structure | Description |
|---|---|---|
text | {"type": "text", "text": "description text"} | Text description |
image_url | {"type": "image_url", "image_url": {"url": "..."}} | Reference image (HTTPS URL or base64 data URI) |
video_url | {"type": "video_url", "video_url": {"url": "..."}} | Reference video (HTTPS URL) |
audio_url | {"type": "audio_url", "audio_url": {"url": "..."}} | Reference audio (HTTPS URL) |
Seedance supported sizes (size parameter auto-mapping)
The table below lists output pixel dimensions for seedance 2.0 / 2.0 fast at different resolution + ratio combinations:
| Resolution | Aspect Ratio | Width × Height |
|---|---|---|
| 480p | 16:9 | 864×496 |
| 480p | 4:3 | 752×560 |
| 480p | 1:1 | 640×640 |
| 480p | 3:4 | 560×752 |
| 480p | 9:16 | 496×864 |
| 480p | 21:9 | 992×432 |
| 720p | 16:9 | 1280×720 |
| 720p | 4:3 | 1112×834 |
| 720p | 1:1 | 960×960 |
| 720p | 3:4 | 834×1112 |
| 720p | 9:16 | 720×1280 |
| 720p | 21:9 | 1470×630 |
Text-to-Video Example (JSON Request)
curl $TURING_BASE_URL/videos \
-H "Authorization: Bearer $TURING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "please generate a video of a cat playing piano",
"model": "turing/veo-3.1-generate",
"size": "1280x720",
"seconds": "6"
}'
Response example (HTTP 200):
{
"id": "video-xxx",
"status": "in_progress",
"model": "turing/veo-3.1-generate"
}
Image-to-Video Example (multipart/form-data)
When a reference image is required, upload the file using the form field input_reference; the filename and MIME type are mandatory.
Note: The uploaded image file must not exceed 10 MB. For Gemini Veo models, if you need to generate a video based on a portrait image (including faces), additionally pass
personGeneration=allow_all.
curl $TURING_BASE_URL/videos \
-H "Authorization: Bearer $TURING_API_KEY" \
-F "prompt=Generate a video that from the facade of the picture showing in the file to the real Pompidou Center" \
-F "model=turing/veo-3.1-generate" \
-F "size=1280x720" \
-F "seconds=6" \
-F "personGeneration=allow_all" \
-F "input_reference=@tests/e2e/video_image.jpg;type=image/jpeg"
Python Example
import requests
BASE_URL = "https://live-turing.cn.llm.tcljd.com/api/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
payload = {
"prompt": "Generate a video that from the facade of the picture showing in the file to the real Pompidou Center",
"model": "turing/veo-3.1-generate",
"size": "1280x720",
"seconds": "6",
"personGeneration": "allow_all",
}
with open("tests/e2e/video_image.jpg", "rb") as f:
# Ensure the file size does not exceed 10 MB
files = {"input_reference": ("pompidou.jpg", f.read(), "image/jpeg")}
res = requests.post(f"{BASE_URL}/videos", data=payload, files=files, headers=HEADERS)
res.raise_for_status()
video_id = res.json()["id"]
print(f"Created video task: {video_id}")
Seedance Request Example (JSON Request)
Using the content array together with native parameters such as resolution, ratio, and duration enables finer-grained control.
curl $TURING_BASE_URL/videos \
-H "Authorization: Bearer $TURING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A cat playing the piano",
"model": "doubao-seedance-2-0-260128",
"content": [
{"type": "text", "text": "A cat playing the piano in a warm living room with sunlight streaming in"},
{"type": "image_url", "image_url": {"url": "https://example.com/cat_reference.jpg"}}
],
"resolution": "1080p",
"ratio": "16:9",
"duration": 6,
"seed": 42,
"generate_audio": true,
"return_last_frame": false
}'
Polling Task Status
GET /videos/{video_id} returns the current status.
The recommended polling interval is 20–30 seconds to avoid excessive requests.
curl -X GET $TURING_BASE_URL/videos/$VIDEO_ID \
-H "Authorization: Bearer $TURING_API_KEY" \
-H "Content-Type: application/json"
import asyncio
import requests
async def wait_until_done(video_id: str):
# Recommended: check every 20–30 seconds
poll_interval = 30
for _ in range(20): # Adjust the retry count based on expected generation time
res = requests.get(f"{BASE_URL}/videos/{video_id}", headers=HEADERS)
res.raise_for_status()
data = res.json()
if data["status"] == "completed":
return data
if data["status"] == "failed":
raise RuntimeError(f"Video {video_id} failed")
await asyncio.sleep(poll_interval)
raise TimeoutError(f"Video {video_id} not finished in time")
Downloading Video Content
Once generation is complete, retrieve the binary video stream (Content-Type: video/mp4) via GET /videos/{video_id}/content.
curl -X GET $TURING_BASE_URL/videos/$VIDEO_ID/content \
-H "Authorization: Bearer $TURING_API_KEY" \
-o output.mp4
Errors & Common Limitations
General Limitations
- File size: Uploading an image larger than 10 MB returns HTTP 400.
- Status management: Video generation can take a significant amount of time. Ensure your client has a sufficient timeout or uses an asynchronous polling mechanism.
Veo Model Limitations
seconds: Must be"4","6", or"8".size: Must be"1280x720"or"720x1280".input_reference: Images only.personGeneration=allow_all: Supported only by Gemini Veo models; permits video generation based on portrait images (including faces).