接口的路径、请求体、响应体、状态、错误格式与 BytePlus ModelArk 官方「视频生成」API 一致,
已经按官方 SDK / 文档写好的代码,把地址换成 https://dreamina.ntokenx.com、Key 换成我们发的即可调用。
当前为测试阶段:不收费,每个 Key 有测试额度(见下文「测试额度」)。
请求头 Authorization: Bearer <你的 Key>(Key 由我们发放)。
curl https://dreamina.ntokenx.com/api/v3/contents/generations/tasks \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"model":"dreamina-seedance-2-0-mini-260615","content":[{"type":"text","text":"a cat walking on the beach at sunset"}]}'
# → {"id": "cgt-…"},再 GET /api/v3/contents/generations/tasks/{id} 轮询到 succeeded
| 方法 | 路径 | 说明 |
|---|---|---|
| POST | /api/v3/contents/generations/tasks |
创建任务,返回 {"id": "cgt-…"} |
| GET | /api/v3/contents/generations/tasks/{id} |
查询任务 |
| GET | /api/v3/contents/generations/tasks?page_num=1&page_size=10&filter.status=&filter.model=&filter.task_ids= |
任务列表(只看得到自己 Key 提交的) |
| DELETE | /api/v3/contents/generations/tasks/{id} |
queued → 取消;已结束 → 删除记录;running 不能取消 |
状态:queued → running → succeeded / failed / cancelled / expired。任务保留 7 天(Draft 任务 14 天)。
| 模型 ID | 分辨率 | 时长(秒) | 文生 | 首帧 | 首尾帧 | 参考图/视频/音频 | 编辑 / 延长 |
|---|---|---|---|---|---|---|---|
dreamina-seedance-2-5-260628 |
480p / 720p(默认)/ 1080p | 4–30,默认 5 | ✓ | ✓ | ✓ | 图 ≤30 / 视频 ≤10 / 音频 ≤10 | ✓ |
同上 + "draft": true(样片) |
480p | 4–30,默认 5 | ✓ | ✓ | ✓ | ✓ | — |
dreamina-seedance-2-0-260128 |
720p(默认)/ 1080p / 4k | 4–15,默认 5 | ✓ | ✓ | ✓ | 图 ≤9 / 视频 ≤3 / 音频 ≤3 | — |
dreamina-seedance-2-0-fast-260128 |
720p | 4–15,默认 5 | ✓ | ✓ | ✓ | 同上 | — |
dreamina-seedance-2-0-mini-260615 |
720p | 4–15,默认 5 | ✓ | ✓ | ✓ | 同上 | — |
{
"model": "dreamina-seedance-2-0-mini-260615",
"content": [
{"type": "text", "text": "@Image1 的女孩在东京街头回头微笑"},
{"type": "image_url", "image_url": {"url": "https://…/a.png"}, "role": "reference_image"}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": true,
"return_last_frame": false,
"callback_url": "https://your.server/callback"
}
content[]:
| type | role | 说明 |
|---|---|---|
text |
— | 提示词。引用素材写 @Image1 / @Video1 / @Audio1(按类型第 n 个) |
image_url |
first_frame / last_frame |
首帧 / 尾帧(与参考素材互斥;尾帧必须配首帧) |
image_url |
reference_image |
参考图 |
video_url |
reference_video |
参考视频(编辑 / 延长的源视频也是它) |
audio_url |
reference_audio |
参考音频(2.0 系列不能只传音频) |
draft_task |
— | {"type":"draft_task","draft_task":{"id":"<draft 任务 id>"}}:把 2.5 样片生成为 1080p 正片 |
素材 url 支持 http(s) 地址或 data: base64。
其它参数:
| 参数 | 默认 | 说明 |
|---|---|---|
resolution |
720p(样片 480p,正片 1080p) | 见模型表 |
ratio |
文生 16:9,其它 adaptive |
21:9 16:9 4:3 1:1 3:4 9:16;adaptive 只用于带首帧/参考素材的任务(按素材比例)。2.5 首帧/首尾帧、编辑、延长只能 adaptive |
duration |
5 | 整数秒,范围见模型表;编辑任务不传(跟随源视频,即 -1) |
omni_reference_task_type |
auto |
reference / edit / extend(编辑、延长仅 2.5,需要 reference_video;延长返回源视频 + 新增段的完整视频) |
draft |
false | 2.5 样片模式(480p,积分更少),满意后用 draft_task 生成正片 |
generate_audio |
true | false = 无声视频 |
camera_fixed |
false | 固定镜头(带参考素材的任务不支持) |
return_last_frame |
false | true = 额外返回尾帧 jpeg |
callback_url |
— | 任务状态变化时 POST 回调,内容同查询响应 |
execution_expires_after |
172800 | 秒,[3600, 259200],超时未完成标 expired |
参数也可以写在提示词末尾:--rs 720p --rt 9:16 --dur 8 --cf true。
{
"id": "cgt-20261103170000-ab12c",
"model": "dreamina-seedance-2-0-mini-260615",
"status": "succeeded",
"content": {"video_url": "https://dreamina.ntokenx.com/files/cgt-….mp4", "file_expires_at": 1793900000},
"usage": {"completion_tokens": 86400, "total_tokens": 86400, "dreamina_credits": 28},
"resolution": "720p", "ratio": "16:9", "duration": 5, "framespersecond": 24,
"generate_audio": true, "service_tier": "default", "created_at": 1793600000, "updated_at": 1793600120, "error": null
}
video_url 有效期 7 天(到期时间见 file_expires_at),请及时下载保存。usage.dreamina_credits 为本次任务消耗的积分。
每个 Key 有两项上限(具体数值随 Key 告知,需要调整请联系我们):
QuotaExceeded,等已有任务结束再提交。usage.dreamina_credits 累计,失败 / 取消的不计;用完返回 HTTP 429 SetLimitExceeded。以下官方模型 / 参数暂不支持,传入会直接返回错误:
ModelNotOpen)。seed、frames、watermark: true、output_format: mov、priority、tools、safety_identifier、
service_tier: flex;文生视频的 ratio: adaptive;duration: -1(编辑任务除外)。格式 {"error": {"code": "...", "message": "..."}}。常见:
| code | 说明 |
|---|---|
AuthenticationError |
Key 缺失 / 无效 / 已停用 |
InvalidParameter / InvalidParameter.TaskTypeConstraint |
参数不合法(message 写明原因和可选值) |
ModelNotOpen |
模型不提供 |
OutputVideoSensitiveContentDetected / OutputImageSensitiveContentDetected |
未通过内容审核,不计积分,请调整提示词或素材后重试 |
OutputAudioSensitiveContentDetected |
音频未通过版权审核,不计积分 |
QuotaExceeded(429) |
同时进行的任务数达到 Key 上限 |
SetLimitExceeded(429) |
Key 的测试积分额度已用完 |
AccountOverdueError(403) |
服务额度暂时不足,请联系我们 |
TaskExpired |
超过 execution_expires_after 仍未执行 |
InternalServiceError(500) |
生成失败或服务暂时繁忙,请稍后重试 |