Documentation
Integrate text / image → video generation into your own system via the API.
Last updated: 2026-06-19
Quick start
Yunzhen exposes a REST API so you can integrate video generation into your own system. Three steps to your first video:
- Get an API key — create one under Admin → API Key management, and send it as
Authorization: Bearer <key>. - Submit a job —
POST /api/v1/video/generate, which returns task info (including a task ID). - Poll for status —
GET /api/v1/video/status?taskId=<id>; read the video URL once the status is completed.
All endpoints return a uniform shape: { "code": 0, "message": "ok", "data": { ... } }. A non-zero code means an error, with message describing it.
Three generation modes
The request body fields decide the path:
- Text to video (T2V) — send only
prompt. - Image to video (I2V) — send
firstFrameImage(and optionallastFrameImagefor storyboard continuity). - Multi-image reference — send an
imagesarray of reference images.
Generate a video
POST /api/v1/video/generate
Headers: Authorization: Bearer <API_KEY>, Content-Type: application/json
Body fields:
promptrequired — text prompt, up to 10000 characters.model— model name, defaults todoubao-seedance-2-0.resolution—480p/720p/1080p/2k/4k, defaults to720p.duration— clip length in seconds, 1–30, defaults to 5.firstFrameImage/lastFrameImage— first/last frame image URLs for image-to-video.images— array of reference image URLs.
Request:
POST /api/v1/video/generate
Authorization: Bearer sk-xxxxxxxx
Content-Type: application/json
{
"prompt": "Cyberpunk city at night, neon lights, cinematic camera",
"model": "doubao-seedance-2-0",
"resolution": "1080p",
"duration": 5
}
Response:
{
"code": 0,
"message": "ok",
"data": {
"taskId": "task_abc123",
"status": "pending"
}
}
Query a task
GET /api/v1/video/status?taskId=<taskId>
Headers: Authorization: Bearer <API_KEY>
Poll until status is completed, then read the video URL from data. Requesting a task that doesn't belong to the key owner returns an error.
{
"code": 0,
"message": "ok",
"data": {
"taskId": "task_abc123",
"status": "completed",
"videoUrl": "https://cdn.../video.mp4"
}
}
Video CDN URLs are time-limited — re-host or download promptly.
Billing
Recharge rate: ¥1 = 100 credits. Each generation pre-charges credits as duration × per-resolution price; insufficient credits returns an error. Unit prices are configured by admins under Admin → Pricing, per channel × model × resolution.
Creative ad workflow
Recommended usage for advertisers — turn one product hook into a whole batch of ready-to-run assets:
- Expand the script — use text models to turn the hook into multiple storyboards and copy.
- Batch submit — call
/api/v1/video/generateonce per script × aspect ratio. - Poll the batch — track each task with
/api/v1/video/status. - Export to ads — read the video URLs and distribute by ratio to your ad channels for testing.
Prefer a visual workflow? Try the workspace directly — no code required.