跳转到主要内容
当任务到达终态(SUCCESS / FAILURE / TIMEOUT / CANCELLED)时,如果提交时指定了 callBackUrl,系统会向该地址发送 POST 请求。

回调格式

POST <callBackUrl>
Content-Type: application/json
回调 data 字段与查询接口响应格式完全一致:
{
  "code": 0,
  "msg": "ok",
  "data": {
    "taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "status": "SUCCESS",
    "input": {
      "model": "jimeng-4.5",
      "prompt": "一只在星空下奔跑的柴犬",
      "ratio": "16:9",
      "resolution": "2k"
    },
    "result": {
      "type": "image",
      "urls": ["https://cdn.example.com/image1.jpg"]
    },
    "created_at": "2026-02-11T10:00:00Z",
    "updated_at": "2026-02-11T10:01:30Z"
  }
}

result 字段结构

SUCCESS 时:
字段类型说明
typestring结果类型:image(图片)或 video(视频)
urlsstring[]资源 URL 列表。图片可能多张,视频通常 1 个
FAILURE / TIMEOUT / CANCELLED 时: resultnull

注意事项

  • Webhook 超时时间为 5 秒,异步发送不阻塞主流程
  • 发送失败仅记录日志,不会重试
  • callBackUrl 不支持 localhost / 127.0.0.1 等内网地址(SSRF 防护)
  • 外层 code 始终为 0,需要通过 data.status 判断成功或失败