通用接口

视频任务查询

Markdown
GEThttps://api.storymo.art/v1/videos/{task_id}

GET /v1/videos/{task_id}

认证

请求头 Authorization: Bearer YOUR_API_KEY。API Key 可在网站“开发者 API”页面创建。

路径参数

参数类型必填说明
task_idstring是提交接口返回的 task_id;拼接 URL 时编码

无请求体。只能查询当前账户的视频任务;任务不存在、类型错误或不属于当前账户均返回 404。

返回 data 字段

字段类型说明
task_idstring任务 ID
taskIdstring兼容别名
typestringvideo
statusstringqueued、running、succeeded、failed、canceled
progressnumber参考进度;以 status 判断是否完成
outputsarray成功时包含 {type,url};其他状态或链接不可用时为空
videoUrlstring/null兼容的结果链接,推荐统一读取 outputs
errorobject/null失败时包含 code、message、error_id
creditsnumber任务记录的积分,不代表退款后的净额
created_atstring创建时间,通常为 ISO 8601
completed_atstring/null终结时间,未完成时可能为 null

轮询与下载

  • queued:排队中,继续查询。
  • running:生成中,继续查询。
  • succeeded:已完成,下载 outputs[0].url。
  • failed:失败,停止查询并显示 error。
  • canceled:已取消,停止查询。

建议每 3–5 秒查询一次;网络错误退避到 10–30 秒。等待超时可保留 task_id 稍后续查,不需重新创建任务。成功但 outputs 为空时稍后重查;持续为空可联系平台。下载链接可能过期,重新查询获取链接。下载请求不带 API Key。

curl --request GET "https://api.storymo.art/v1/videos/${TASK_ID}" \
  --header "Authorization: Bearer $DRAMAGEN_API_KEY"
响应示例
{
  "code": "ok",
  "message": "success",
  "data": {
    "task_id": "task_example",
    "taskId": "task_example",
    "type": "video",
    "status": "succeeded",
    "progress": 100,
    "outputs": [
      {
        "type": "video",
        "url": "https://cdn.example.com/result.mp4"
      }
    ],
    "videoUrl": "https://cdn.example.com/result.mp4",
    "error": null,
    "credits": 20,
    "created_at": "2026-10-31T04:00:00.000Z",
    "completed_at": "2026-10-31T04:01:00.000Z"
  },
  "requestId": "req_example"
}