提交任务
- 用 OpenAI 风格的结构提交视频任务
- 字段由网关映射到上游原生格式
- 适合已有 OpenAI 调用链的项目快速接入
认证
所有接口均使用 Bearer Token 进行认证。
Seedance 系列的接口需要在 ark 站 单独获取 Key,与 api 站的 Key 不通用。
请求时在请求头中添加:
Authorization: Bearer YOUR_ARK_KEYAll endpoints authenticate with a Bearer token.
Seedance series endpoints require a key obtained separately from the ark site; it isn't shared with the api site's key.
Add it to the request header:
Authorization: Bearer YOUR_ARK_KEY请求结构
prompt、image、duration、size 等字段全部平铺在请求体顶层,没有 content 数组,也没有 metadata 包装。图片放进 image 单字段,固定按首帧处理。其余参数(fps、seed、response_format、callback_url)同样在顶层。
与豆包原生的差异见下方「与原生结构的差异」。
prompt, image, duration, size, and the other fields all sit flat at the top level, with no content array and no metadata wrapper. An image goes in the single image field and is always treated as the first frame. The other parameters (fps, seed, response_format, callback_url) are likewise at the top level.
For the differences from Doubao native, see "Differences from the native structure" below.
支持的场景
| 场景 | 字段组合 |
|---|---|
| 文生视频 | prompt |
| 图生视频·首帧 | prompt + image |
| 图生视频·首尾帧 | 改用豆包原生通道,见视频生成(豆包原生) |
| 全模态参考 | 改用豆包原生通道,见视频生成(豆包原生) |
| 编辑视频 | 改用豆包原生通道,见视频生成(豆包原生) |
| 延长视频 | 改用豆包原生通道,见视频生成(豆包原生) |
OpenAI 兼容结构只有 prompt 与 image 两个创作字段,能表达的场景比豆包原生少。需要首尾帧、参考图、视频编辑或延长时,用豆包原生通道提交,任务查询仍然走同一个任务状态接口。
| Scenario | Field combination |
|---|---|
| Text to video | prompt |
| Image to video, first frame | prompt + image |
| Image to video, first and last frame | Use the Doubao native channel; see Video generation (Doubao native) |
| All-modality reference | Use the Doubao native channel; see Video generation (Doubao native) |
| Video editing | Use the Doubao native channel; see Video generation (Doubao native) |
| Video extension | Use the Doubao native channel; see Video generation (Doubao native) |
The OpenAI-compatible schema has only two creative fields, prompt and image, so it expresses fewer scenarios than Doubao native. For first-and-last frames, reference images, video editing, or extension, submit through the Doubao native channel; task polling still uses the same task status endpoint.
请求参数
视频模型 ID。
视频描述。写清主体动作、镜头运动与环境氛围。
首帧图片地址,支持 HTTP(S) 与 Base64 data URI。传入后进入图生视频模式。
时长,单位秒。不传时由模型按默认值处理。
输出画幅,写成 1280x720 这类像素值,或直接用比例字符串。
帧率。部分模型固定帧率,传了会被忽略。
随机种子。
url 返回可访问地址,固定为默认值。
完成回调地址。不传则用任务状态接口轮询。
The video model ID.
The video description. Spell out the subject's action, camera movement, and atmosphere.
The first-frame image URL; HTTP(S) and Base64 data URIs are supported. Including it enters image-to-video mode.
Duration in seconds. When omitted, the model applies its default.
Output framing, as pixels such as 1280x720 or as a plain ratio string.
Frame rate. Some models have a fixed frame rate and ignore this.
Random seed.
url returns an accessible address; this is fixed as the default.
The completion callback URL. Without it, poll the task status endpoint.
响应
任务 ID。
固定为 video.generation。
任务状态。提交后为 queued。
创建时间戳。
实际使用的模型。
这是同步受理、异步出片的接口。返回值里只有任务状态,没有视频本身。要拿成片,用返回的 id 去任务状态接口轮询,或配置 callback_url。
The task ID.
Always video.generation.
The task status. queued after submission.
Creation timestamp.
The model actually used.
This endpoint accepts synchronously and renders asynchronously. The return value carries only the task status, not the video itself. To get the finished video, poll the task status endpoint with the returned id, or configure callback_url.
错误码
| HTTP | 含义 |
|---|---|
| 400 | 参数错误,type 为 invalid_request_error |
| 401 | Token 缺失或无效,type 为 authentication_error |
| 402 | 余额不足,type 为 permission_error |
| 429 | 触发限流 |
| HTTP | Meaning |
|---|---|
| 400 | Invalid parameters, with type invalid_request_error |
| 401 | Token missing or invalid, with type authentication_error |
| 402 | Insufficient balance, with type permission_error |
| 429 | Rate limit hit |
For more status codes and retry guidance see Error codes and rate limits; for troubleshooting steps on common errors see the FAQ.
与原生结构的差异
| 原生 | OpenAI 兼容 | 说明 |
|---|---|---|
content[].type = text | prompt 字符串 | 文本被包装成 content 条目 |
content[].image_url + role | image 单字段 | 固定按首帧处理 |
ratio | size | 比例或像素都可 |
callback_url | callback_url | 一致 |
| Native | OpenAI-compatible | Notes |
|---|---|---|
content[].type = text | prompt string | Text is wrapped as a content entry |
content[].image_url + role | image single field | Always treated as the first frame |
ratio | size | Ratio or pixels both work |
callback_url | callback_url | Identical |
用 multipart 上传本地文件
JSON 请求体不能直接携带二进制文件。首帧图如果要本地直传,改用 multipart/form-data:
curl --request POST --url 'https://ark.oairoute.com/v1/video/generations' --header 'Authorization: Bearer YOUR_ARK_KEY' --form 'model=seedance-2.5' --form 'prompt=海面日落,镜头缓慢前推' --form '[email protected]' --form 'duration=5' --form 'size=1280x720'两个容易踩的坑:
- 数字要写成字符串。 multipart 里没有类型概念,
duration=5与duration="5"传输上一样,但部分客户端会把5序列化成5.0,被判为非法整数 image与image_url互斥。 同时出现返回 400
multipart 的请求体比 JSON 大,10MB 以上的图片在慢网络下容易超时,建议改用先上传再引用。
A JSON body can't carry binary files directly. To upload a first-frame image from disk, use multipart/form-data:
curl --request POST --url 'https://ark.oairoute.com/v1/video/generations' --header 'Authorization: Bearer YOUR_ARK_KEY' --form 'model=seedance-2.5' --form 'prompt=Sunset over the sea, camera slowly pushing in' --form '[email protected]' --form 'duration=5' --form 'size=1280x720'Two common traps:
- Write numbers as strings. Multipart has no type system, so
duration=5andduration="5"transmit the same; but some clients serialize5as5.0, which is rejected as an invalid integer imageandimage_urlare mutually exclusive. Passing both returns a 400
Multipart bodies are larger than JSON, and images over 10MB time out easily on slow networks; uploading first and referencing is recommended.
metadata 透传容器
metadata 是自由格式对象,服务端不校验内部键名,只做两件事:原样保存、在任务查询时原样返回。
{
"model": "seedance-2.5",
"prompt": "海面日落",
"metadata": {
"order_id": "A20261030-001",
"user_id": "u_88213"
}
}序列化后不超过 4KB,超限返回 400。
| 适合放 | 不适合放 |
|---|---|
| 订单号、工单号 | 密钥、Token |
| 用户标识 | 身份证号、银行卡号 |
| 批次编号 | 大段提示词 |
| 调用来源标记 | 二进制数据 |
metadata 不进入模型,写进去的「让画面更亮一点」不会影响生成结果。需要影响生成的内容一律放 prompt。
metadata 会随任务持久化,也会出现在回调里。写进去的东西等于长期存在平台侧,敏感信息不要放这里。
metadata is a free-form object; the server doesn't validate its keys and does only two things: store it verbatim and return it verbatim on task queries.
{
"model": "seedance-2.5",
"prompt": "Sunset over the sea",
"metadata": {
"order_id": "A20261030-001",
"user_id": "u_88213"
}
}It must fit in 4KB after serialization; exceeding that returns a 400.
| Good to put here | Not suitable |
|---|---|
| Order numbers, ticket numbers | Keys, tokens |
| User identifiers | ID numbers, bank card numbers |
| Batch numbers | Long prompts |
| Call-origin markers | Binary data |
metadata never reaches the model; writing "make it brighter" there won't affect the generation. Anything that should influence generation belongs in prompt.
metadata persists with the task and also appears in callbacks. Whatever you write there lives on the platform long-term, so don't put sensitive information here.
支持的模型列表
以下视频模型均可通过本接口提交任务,清单只列各厂商最新一代,实际可用范围以你的账号分组为准:
Seedance 系列
seedance-2.5旗舰,支持音画同步seedance-2.0上一代主力seedance-2.0-fast快速版seedance-2.0-mini轻量,成本最低 等
更多模型持续更新中…
各型号的能力差异:
| 项目 | 2.0 家族 | 2.5 |
|---|---|---|
| 最长时长 | 15 秒 | 30 秒 |
| 分辨率 | 480p / 720p / 1080p / 4k | 480p / 720p / 1080p |
2.0 家族里 fast 与 mini 只支持 480p 与 720p,4K 仅 2.0 标准版可用。
GET https://ark.oairoute.com/api/pricing。Every video model below can be submitted through this endpoint; the list shows only each vendor's latest generation, and what your account group actually allows takes precedence:
Seedance 系列
seedance-2.5旗舰,支持音画同步seedance-2.0上一代主力seedance-2.0-fast快速版seedance-2.0-mini轻量,成本最低 等
更多模型持续更新中…
Differences between model families:
| Item | 2.0 family | 2.5 |
|---|---|---|
| Max duration | 15 s | 30 s |
| Resolution | 480p / 720p / 1080p / 4k | 480p / 720p / 1080p |
Within the 2.0 family, fast and mini support only 480p and 720p; 4K is available only on the 2.0 standard model.
GET https://ark.oairoute.com/api/pricing.使用示例
文生视频
OpenAI 兼容结构把文本放进 prompt,图片放进 image,比原生通道少一层 content 数组包装。提交返回 task_id,再轮询任务状态接口。
图生视频
image 固定按首帧处理。需要控制末帧请改用豆包原生通道。
指定时长与帧率
duration 单位是秒,fps 决定流畅度。时长越长、帧率越高,耗时和费用都会上去。
回调通知
大批量任务不要靠轮询,传 callback_url,任务完成时平台会主动 POST 结果过来。
Text to video
The OpenAI-compatible schema puts text in prompt and an image in image, one layer of content-array wrapping less than the native channel. Submission returns a task_id; poll the task status endpoint from there.
Image to video
image is always treated as the first frame. To control the last frame, use the Doubao native channel instead.
Setting duration and frame rate
duration is in seconds and fps determines smoothness. Longer duration and higher frame rate both raise time and cost.
Callback notification
For large batches, don't rely on polling — pass callback_url and the platform POSTs the result when the task completes.