API 参考
Veo3.1 Video API
通过 Xenodia 创建异步 Veo3.1 video task,并用标准 task API 轮询。
使用 POST /v1/videos/generations 在 Xenodia 上进行 public Veo3.1 video generation。
Video generation 只支持 task mode。提交 request,保存 task ID,然后通过 Task Retrieval 轮询。
Endpoint
POST https://api.xenodia.xyz/v1/videos/generationsPOST /v1/video/generations 也注册为 compatibility alias。新接入优先使用 plural /v1/videos/generations。
Text-to-video request
{
"model": "veo3.1_fast",
"prompt": "A cinematic close-up of a developer dashboard showing model routing and API latency.",
"generationType": "TEXT_2_VIDEO",
"aspect_ratio": "16:9",
"resolution": "720p"
}Reference-to-video request
{
"model": "veo3.1_fast",
"prompt": "Animate the reference into a polished product walkthrough.",
"generationType": "REFERENCE_2_VIDEO",
"imageUrls": [
"https://example.com/reference-1.png",
"https://example.com/reference-2.png"
],
"aspect_ratio": "16:9",
"resolution": "1080p"
}Supported public models
| Model | Notes |
|---|---|
veo3.1 | Quality model。 |
veo3.1_fast | Fast model 和默认值;REFERENCE_2_VIDEO 必须使用它。 |
veo3.1_lite | Lite model。 |
Generation types
| Type | Reference rule |
|---|---|
TEXT_2_VIDEO | 不传 imageUrls。 |
FIRST_AND_LAST_FRAMES_2_VIDEO | 需要 1-2 个 imageUrls。 |
REFERENCE_2_VIDEO | 需要 1-3 个 imageUrls,且只支持 veo3.1_fast。 |
Parameters
| Field | Notes |
|---|---|
prompt | 必填文本 prompt。 |
imageUrls | 可选 public image URL,最多 3 个。 |
model | veo3.1、veo3.1_fast 或 veo3.1_lite。 |
generationType | 可选模式;不传时由 imageUrls 推断。 |
aspect_ratio | 16:9、9:16 或 Auto。默认 16:9。 |
resolution | 720p、1080p 或 4k。默认 720p。 |
seeds | 可选 integer,10000 到 99999。 |
enableFallback | 可选 deprecated compatibility switch。 |
enableTranslation | 可选 boolean,默认启用。 |
watermark | 可选 watermark text。 |
callBackUrl | 可选 completion callback URL;Xenodia task polling 仍可用。 |
Pricing
Veo3.1 不是 token pricing。Xenodia 按 accepted video task 固定计费,tier 由 resolution 选择。
| Resolution | Billing unit |
|---|---|
720p | Per generated video |
1080p | Per generated video |
4k | Per generated video |
价格敏感 UI 上线前先查询 /v1/models。Capability payload 会暴露 capabilities.pricing.mode = "resolution" 和 resolution tiers。
Response
返回 Xenodia media task envelope:
{
"task_id": "task_123",
"object": "task",
"model": "veo3.1_fast",
"type": "video",
"state": "waiting",
"created_at": 1760000000,
"poll_url": "/v1/tasks/task_123",
"recommended_poll_interval_ms": 5000
}轮询成功后,result 包含 generated video URL:
{
"task_id": "task_123",
"state": "success",
"result": {
"created": 1760000100,
"data": [
{
"url": "https://cdn.example.com/video.mp4"
}
],
"resolution": "720p"
},
"progress": 100,
"poll_url": "/v1/tasks/task_123"
}常见错误:400 参数组合无效,401 key 无效,402 billing boundary,502 task creation failure。