绘梦绘梦

我的 API

管理 API Key,并通过开放接口异步调用平台能力。

调用地址
生成接口https://hmtm.cn/api/open/v1/generations
查询接口https://hmtm.cn/api/open/v1/tasks/{taskId}

API Key

加载中...

Seedance 2.0 API 文档

鉴权

在请求头中传入 API Key,支持两种方式:

Authorization: Bearer YOUR_API_KEY

或使用 X-API-Key: YOUR_API_KEY

1. 提交生成任务

POSThttps://hmtm.cn/api/open/v1/generations

请求参数 (JSON Body)

abilityId 外,所有参数均为 Seedance 2.0 原生字段。

字段类型必填说明
abilityIdstring能力标识,固定为 cme_doubao_seedance_2_0
contentobject[]输入内容数组,每个元素为以下类型之一:
  • {"type":"text","text":"提示词"}
  • {"type":"image_url","image_url":{"url":"https://..."},"role":"reference_image"}
  • {"type":"video_url","video_url":{"url":"https://..."},"role":"reference_video"}
  • {"type":"audio_url","audio_url":{"url":"https://..."},"role":"reference_audio"}
durationnumber生成视频时长(秒)。
ratiostring画面比例:16:9 / 4:3 / 1:1 / 3:4 / 9:16 / 21:9 / adaptive
resolutionstring分辨率:480p / 720p1080p 即将开放。
generate_audioboolean是否生成音频。
return_last_frameboolean是否返回尾帧图像。
watermarkboolean是否添加水印。
seednumber随机种子,用于结果复现。传入 -1 使用随机种子。

提交响应

字段类型说明
taskIdstring任务唯一标识,用于后续查询。
statusstringqueued
createdAtstring任务创建时间。
2. 查询任务状态

GEThttps://hmtm.cn/api/open/v1/tasks/{taskId}

通过任务 ID 查询进度和结果。建议间隔 3-5 秒轮询。

查询响应

字段类型说明
taskIdstring任务唯一标识。
statusstringqueued(排队)/running(生成中)/succeeded(完成)/failed(失败)
progressnumber进度百分比,0-100。
outputobject | null成功后返回。包含 videoUrl(视频地址)。
billingobject | null成功后返回。deductedCredits 为实际扣除积分。
errorstring | null失败时的错误信息。
createdAtstring任务创建时间。
completedAtstring | null任务完成时间。
curl 示例

文生视频

curl -X POST "https://hmtm.cn/api/open/v1/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "abilityId": "cme_doubao_seedance_2_0",
    "content": [
      {"type": "text", "text": "一只猫在草地上奔跑,阳光明媚,电影质感"}
    ],
    "duration": 5,
    "ratio": "16:9"
  }'

图生视频(参考图片 + 提示词)

curl -X POST "https://hmtm.cn/api/open/v1/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "abilityId": "cme_doubao_seedance_2_0",
    "content": [
      {"type": "text", "text": "人物转头微笑,自然光线"},
      {"type": "image_url", "image_url": {"url": "https://example.com/ref-image.jpg"}}
    ],
    "duration": 5,
    "ratio": "adaptive"
  }'

视频参考(参考视频 + 提示词)

curl -X POST "https://hmtm.cn/api/open/v1/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "abilityId": "cme_doubao_seedance_2_0",
    "content": [
      {"type": "text", "text": "延续参考视频的风格和动作"},
      {"type": "video_url", "video_url": {"url": "https://example.com/ref-video.mp4"}}
    ],
    "duration": 5
  }'

查询任务

curl -X GET "https://hmtm.cn/api/open/v1/tasks/YOUR_TASK_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"
扣费说明

任务完成后自动按 API 计费规则扣费(与站内分开配置),享受会员等级折扣。 扣费记录可在「扣费记录」查看。