curl --request POST \
--url https://api.aiohub.org/v1/contents/generations/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seedance-2-5-260628",
"content": [
{
"type": "text",
"text": "A blue ceramic cup on a wooden table in daylight, slow camera push-in."
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}
'{
"id": "task_ADQ5XK6AKWg36WePoJ3sZRyDvWl1ogGZ"
}{
"code": "invalid_duration",
"message": "duration must be between 4 and 30 seconds for this model"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}创建视频 · Ark / Seedance
使用 Ark / Seedance 格式提交 Seedance 视频任务,查看示例、输入限制和完整参数。
POST
/
v1
/
contents
/
generations
/
tasks
curl --request POST \
--url https://api.aiohub.org/v1/contents/generations/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seedance-2-5-260628",
"content": [
{
"type": "text",
"text": "A blue ceramic cup on a wooden table in daylight, slow camera push-in."
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}
'{
"id": "task_ADQ5XK6AKWg36WePoJ3sZRyDvWl1ogGZ"
}{
"code": "invalid_duration",
"message": "duration must be between 4 and 30 seconds for this model"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}新接入,或需要参考音频、参考视频、视频编辑时,使用这个格式。模型和价格见 视频模型与计费。
创建成功返回
拿到任务标识后,转到 查询任务。
媒体
与视频或音频一起提交的图片需要
接入配置
服务地址是https://api.aiohub.org。所有请求携带 Authorization: Bearer <AIOHUB_API_KEY>,把占位符替换为完整的 sk- API 令牌,令牌分组需能访问所选模型。
请求示例
最小请求只需提示词,不需要先准备图片。curl https://api.aiohub.org/v1/contents/generations/tasks \
-H "Authorization: Bearer <AIOHUB_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-5-260628",
"content": [{"type": "text", "text": "A blue ceramic cup on a wooden table in daylight."}],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}'
id,保存它用于后续查询。此时任务尚未完成。
{"id": "task_example"}
图片、音频与视频输入
Ark / Seedance 任务接口的请求体用content[] 数组携带提示词和参考媒体,每个媒体项通过 role 说明用途:
| 媒体类型 | role 取值 |
|---|---|
image_url | first_frame(省略时默认)、last_frame、reference_image |
video_url | reference_video |
audio_url | reference_audio |
url 填 HTTPS 地址;图片和音频也可以用 base64 data URL(如 data:image/png;base64,...)。单个媒体最大 100 MB。
| 输入组合 | 2.5 | 2.0、2.0 fast、2.0 mini |
|---|---|---|
| 仅文本 | 支持 | 支持 |
一张 first_frame 图片 | 支持,任意比例 | 支持,任意比例 |
first_frame + last_frame | 支持,ratio: adaptive | 支持,任意比例 |
仅 reference_image | 1 到 30 张 | 1 到 9 张 |
| 参考图搭配参考视频或音频 | 最多 30 张图、10 段视频、10 段音频 | 最多 9 张图、3 段视频、3 段音频 |
仅 reference_audio | 1 到 10 段 | |
视频编辑(omni_reference_task_type: "edit") | 一段 reference_video,ratio: adaptive,duration: -1 |
role: reference_image。参考视频和音频在 2.5 上每段 2 到 30 秒、合计 30 秒以内;在 2.0 系列上每段 2 到 15 秒、合计 15 秒以内。视频编辑的源视频 4 到 30 秒,输出时长与源视频相同。
状态回调
创建时填写callback_url,AIOHub 会在任务状态变化时把任务对象 POST 到该地址,请求头带 User-Agent: AIOHub-LibTV-Callback/1。请在 5 秒内返回 2xx,否则最多重试三次。
授权
API key (sk-xxx)
请求体
application/json
提示词和参考媒体。文生视频只需一个 text 项。
Show child attributes
Show child attributes
输出分辨率,取值范围随模型不同。
可用选项:
480p, 720p, 1080p, 4k 画面比例。adaptive 由模型根据提示词或输入图片决定。
可用选项:
adaptive, 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 视频时长,整数秒,取值范围随模型不同。视频编辑任务填 -1。
是否生成音频。
参考媒体的使用方式。edit 以一个 reference_video 为源视频做编辑。
可用选项:
auto, reference, edit 为 true 时任务结果包含 content.last_frame_url(最后一帧 JPEG)。
填 [{"type": "web_search"}] 允许模型在生成时联网搜索。
Show child attributes
Show child attributes
排队优先级,数值越大越早出队;不会打断正在运行的任务。
必填范围:
0 <= x <= 9公网 HTTPS 地址。任务状态每次变化时,AIOHub 会把任务对象 POST 到该地址,请在 5 秒内返回 2xx,否则最多重试三次。
稳定的终端用户标识,最长 64 字符,会在任务查询中原样返回。
Maximum string length:
64响应
任务已创建
任务 ID