Skip to content
Platform / Docs / Veo 3.1 API

API Reference

Veo 3.1 API

POST veo-api ID 14

Veo 3.1 video generation from a prompt or a reference image. Parameters follow this page.

POST https://xiaoapis.com/api/video/veo

Overview

  • 文生/图生视频
  • 异步任务
  • 回调

Use cases

  • 高质量视频生成
  • 图片驱动视频
Conventions
  • Gateway · https://xiaoapis.com
  • Auth · send key (query or JSON body, as this API specifies)
  • Response · JSON. Check the business code and the HTTP status, not only HTTP 200

Authentication

Send the platform API key (query parameter key or JSON field key, as this page specifies). Create one in API key management.

POST https://xiaoapis.com/api/video/veo
Content-Type: application/json

{
  "key": "YOUR_API_KEY"
}

Request example

https://xiaoapis.com/api/video/veo?key=你的密钥

Details

请求HEADER:

名称值
Content-Typeapplication/json

请求参数说明:

名称必填类型示例值说明
prompt是stringA dog playing in a park描述所需视频内容的文本提示词。
imageUrls是string[
 "http://example.com/image1.jpg",
 "http://example.com/image2.jpg"
]
图片链接列表(图片生成视频模式使用)。支持1张或2张图片:
model否stringveo3_fast

选择使用的模型类型。 默认:veo3_fast 可用选项:veo3,veo3_fast

generationType
否stringTEXT_2_VIDEO视频生成模式(可选)。可用选项:

TEXT_2_VIDEO,FIRST_AND_LAST_FRAMES_2_VIDEO,REFERENCE_2_VIDEO

指定不同的视频生成方式

TEXT_2_VIDEO:文生视频 - 仅使用文本提示词生成视频

FIRST_AND_LAST_FRAMES_2_VIDEO:首尾帧生视频 - 灵活的图片到视频生成模式

传1张图片:基于该图片生成视频

传2张图片:第一张作为首帧,第二张作为尾帧,生成过渡视频

REFERENCE_2_VIDEO:参考图生视频 - 基于参考图片生成视频,需要在 imageUrls 中提供1-3张图片(至少1张,最多3张)

watermark否string销豹AI

水印文本。如果提供,将在生成的视频上添加水

aspectRatio否string16:9可用选项:16:9,9:16,Auto
seeds否integer12345必填范围: 10000 <= x <= 99999

(可选) 随机种子参数,用于控制生成内容的随机性。取值范围为10000-99999。相同的种子会生成相似的视频内容,不同的种子会生成不同的视频内容。不填写时系统自动分配。

callBackUrl是stringhttp://your-callback-url.com/complete

用于接收视频生成任务完成更新的URL地址。可选但推荐在生产环境中使用。


返回参数说明:

名称类型说明
codeint状态码
msgstring状态信息
datastring请求结果数据集
- taskIdstringveo_task_abcdef123456 任务ID
debugstring/array调试数据
exec_timefloat执行耗时
user_ipstring客户端IP

Response example

<p>{ &nbsp;&quot;code&quot;: 200, &nbsp;&quot;msg&quot;: &quot;success&quot;, &nbsp;&quot;data&quot;: { &nbsp; &nbsp;&quot;taskId&quot;: &quot;veo_task_abcdef123456&quot; &nbsp;}}</p><p><br/></p><p>成功回调:</p><p>{</p><p>&nbsp; &quot;code&quot;: 200,</p><p>&nbsp; &quot;msg&quot;: &quot;Veo3.1 视频生成成功。&quot;,</p><p>&nbsp; &quot;data&quot;: {</p><p>&nbsp; &nbsp; &quot;taskId&quot;: &quot;veo_task_abcdef123456&quot;,</p><p>&nbsp; &nbsp; &quot;info&quot;: {</p><p>&nbsp; &nbsp; &nbsp; &quot;resultUrls&quot;: [&quot;http://example.com/video1.mp4&quot;],</p><p>&nbsp; &nbsp; &nbsp; &quot;originUrls&quot;: [&quot;http://example.com/original_video1.mp4&quot;],</p><p>&nbsp; &nbsp; &nbsp; &quot;resolution&quot;: &quot;1080p&quot;</p><p>&nbsp; &nbsp; },</p><p>&nbsp; &nbsp; &quot;fallbackFlag&quot;: false</p><p>&nbsp; }</p><p>}</p><p><br/></p>

Error codes


错误码类型说明
200int成功 - 请求已成功处理
400int1080P正在处理中。预计1-2分钟后准备就绪。请稍后再次查看。
401int未授权 - 认证凭据缺失或无效
402int
积分不足 - 账户没有足够的积分执行操作
404int未找到 - 请求的资源或端点不存在
422int验证错误 - 请求参数验证失败。当未开启托底且生成失败时,错误信息格式为:Your request was rejected by Flow(原始错误信息). You may consider using our other fallback channels, which are likely to succeed. Please refer to the documentation.
429int请求限制 - 已超过该资源的请求限制
455int服务不可用 - 系统正在进行维护
500int服务器错误 - 处理请求时发生意外错误
501int生成失败 - 视频生成任务失败
505int功能禁用 - 请求的功能当前已禁用


FAQ

威尔 3.1 怎么用?

提交 prompt 等参数创建任务,查询或回调获取视频。

支持参考图吗?

支持图生视频模式时,按文档传入 imageUrls。

如何选分辨率比例?

使用 aspectRatio 等参数,可选值见文档。

和其它视频模型如何选?

按效果、时长、价格与是否需要参考图综合选择。

任务失败?

检查提示词、图片可达性与账户额度。

Full console doc (with the debugger):/doc/14