由 ShengShu 提供
Vidu Q3 Pro (Shengshu) text-to-video and image-to-video, with first/last-frame control. 1–16 second clips at 540p, 720p or 1080p, with generated audio by default. Billed on the tokens the vendor meters.
起 $0.045
每生成秒
540p · 720p · 1080p
計費分級 — 不是您傳送的大小
非同步 API — 影片生成使用非同步流程:提交任務、輪詢直到完成,再從單獨的端點下載檔案。生成需要數分鐘,因此請每 3-5 秒輪詢一次。以下範例展示三個步驟。
# 1. Submit the job. model, prompt and seconds are required. Each account may hold only a small number of
# unfinished jobs at once — 5 by default, set per deployment — and one over that returns 429
# video_jobs_in_flight_limit.
#
# The model's own options go under "metadata"; every field and the values it accepts are listed below.
# Images go in metadata.content as {type: image_url, image_url: {url}, role}, each a URL or a base64 data: URI
# (png, jpeg or webp); the whole request is capped at 24 MB. No image is text-to-video, a first_frame is
# image-to-video, and first_frame + last_frame is first/last-frame. Every request needs a prompt; the aspect
# ratio applies to text-to-video only (an image-led clip follows its image).
curl "https://router-api.0g.ai/v1/videos" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-d '{
"model": "vidu-video-q3-pro",
"prompt": "A cat surfing a wave at sunset",
"seconds": 5,
"metadata": {
"resolution": "720p",
"audio": true,
"watermark": false
}
}'
# Response: {"id": "v0_426354818031858", "status": "queued", "provider_address": "0x..."}
# 2. Poll until status is "completed". Generation takes minutes — 3-5s is a sane interval. The poll answers
# 200 and reports the job's own status, so a failure arrives as 200 + {"status":"failed"}, NOT as an error
# code. The SUBMIT response echoes what you sent; the POLL response reports what was actually rendered — so
# reconcile against the poll. Which fields carry that answer depends on the upstream:
# usage.output_video_duration when the provider reported a duration, size/seconds on some providers and not
# others. Read what is present rather than assuming a particular field.
curl "https://router-api.0g.ai/v1/videos/<VIDEO_ID>" \
-H "Authorization: Bearer <YOUR_API_KEY>"
# 3. Download the finished file. This is where 409 / 424 / 429 live: 409 = not ready yet, 429 = too many
# concurrent downloads (both retryable), 424 = the job failed and has no output (terminal).
curl "https://router-api.0g.ai/v1/videos/<VIDEO_ID>/content" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-o video.mp4
| 輸入 | 角色 | 類型 | 上限 | 情境 |
|---|---|---|---|---|
| 首幀 | first_frame | 圖片 | 1 | 首/末幀 |
| 末幀需要 首幀 | last_frame | 圖片 | 1 | 首/末幀 |
Images go in metadata.content as {type: image_url, image_url: {url}, role}, each a URL or a base64 data: URI (png, jpeg or webp); the whole request is capped at 24 MB. No image is text-to-video, a first_frame is image-to-video, and first_frame + last_frame is first/last-frame. Every request needs a prompt; the aspect ratio applies to text-to-video only (an image-led clip follows its image).
| 欄位 | 值 | 預設 |
|---|---|---|
| metadata.resolution | 540p · 720p · 1080p | 720p |
| seconds | 1–16s | 5 |
| metadata.aspect_ratio | 16:9 · 9:16 · 3:4 · 4:3 · 1:1 | — |
| metadata.audio | true · false | true |
| metadata.seed | 任意整數 | — |
| metadata.watermark | true · false | false |
Billed on the tokens the vendor meters for the clip, $1.6 per 1M; the per-second prices are the vendor's metered rate at each resolution for the dearest mode, and each clip is billed on what it actually meters.
供應商路由
使用 X-0G-Provider-* 請求標頭,控制哪個供應商處理您的請求。
X-0G-Provider-Address 固定供應商;X-0G-Provider-Identity 固定要透過該供應商的哪個上游進行路由。這兩個值都來自 GET /v1/providers 回應中的 address 與 provider_identity 欄位。兩者搭配即可指定某個供應商的特定上游。若兩者都不傳送,路由會依價格與健康狀況挑選,和先前完全相同。
curl "https://router-api.0g.ai/v1/videos" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "X-0G-Provider-Address: <PROVIDER_ADDRESS>" \
-H "X-0G-Provider-Identity: <UPSTREAM>" \
-H "X-0G-Provider-Sort: latency" \
-H "X-0G-Provider-Allow-Fallbacks: true" \
-d '{
"model": "vidu-video-q3-pro",
"prompt": "A cat surfing a wave at sunset",
"seconds": 6
}'