Growth Studio OpenAPI接入文档 · Legacy Template APIs (Deprecated)
旧接入方可继续参考本章;新接入请使用模板创作新接口。旧接口响应带 Deprecation: true 和指向新接口的 Link。本章的本地化 layout、固定 price_per_video 和旧请求格式仅适用于旧接口。
先查询目录选择模板,再提交商品和运行选项。创建成功后使用 video_id 视频状态与结果查询(查询视频详情),并按视频状态与结果查询(视频轮询建议)获取结果。
模板视频由平台提供固定的生成规格。先查询模板目录,再使用返回的 id 创建视频。
请求与 cURL
GET /openapi/v1/video-templates
Authorization: Bearer <API_KEY>
curl --request GET \
"${BASE_URL}/openapi/v1/video-templates" \
--header "Authorization: Bearer ${API_KEY}"
成功响应
以下模板和图片地址仅用于说明格式;创建时请使用实际目录中的模板 ID。
{
"templates": [
{
"id": 1,
"layout": {
"name": "Product Detail Showcase",
"description": "Shows the product details and how it is used.",
"cover_url": "https://media.pixverse.ai/templates/1/cover.jpg",
"video_url": "https://media.pixverse.ai/templates/1/preview.mp4",
"aspect_ratio": "1:1",
"duration": 10,
"resolution": "720p"
},
"price_per_video": 3000
}
],
"request_id": "list-templates-001"
}
| 字段 | 类型 | 说明 |
|---|---|---|
templates |
array | 全部启用模板,按 id 升序排列;没有启用模板时为 [] |
templates[].id |
integer | 创建时使用的 template_id,合法值可以是 0 |
templates[].layout |
object | 展示名称、说明、封面、预览及规格等信息,实际字段以实时目录为准 |
templates[].price_per_video |
integer | 单条视频的积分价格,单位为 milli_credit(毫积分),1000 毫积分等于 1 积分 |
request_id |
string | 请求追踪 ID |
layout 字段按部署地区返回当前语言的值:海外环境为英文,CN 环境为中文,不再嵌套 en、zh。缺失字段可能省略;显式空字符串、null 和数组保持原类型。客户端应兼容不同模板具有不同展示字段。
根对象没有 config、目录版本、币种和价格换算字段。price_per_video 不是人民币分或美元美分;实际扣款以钱包流水为准。目录暂不可用时返回可重试的 503 TEMPLATE_CATALOG_UNAVAILABLE。
一次请求选择一个模板,为一个商品创建一条视频。模型、时长、分辨率、比例及生成价格由模板决定。
请求与 cURL
POST /openapi/v1/template/videos/generations
Authorization: Bearer <API_KEY>
Content-Type: application/json
以下示例手填商品,不包含商品链接。将模板 ID 换为目录中的实际值,商品图片换为真实平台 CDN 地址。
curl --request POST \
"${BASE_URL}/openapi/v1/template/videos/generations" \
--header "Authorization: Bearer ${API_KEY}" \
--header 'Content-Type: application/json' \
--data-raw '{
"template_id": 1,
"product": {
"title": "Linen shirt",
"description": "A lightweight, breathable linen shirt for everyday comfort.",
"brand": "Example",
"images": [
{"url": "https://media.pixverse.ai/marketing_hub_website/upload/shirt.png"}
]
},
"video": {
"language": "en-US",
"voiceover": true,
"captions": false,
"callout_text_switch": true,
"background_music": true
}
}'