跳转到主要内容
GET
/
producer
/
tasks
查询任务状态
curl --request GET \
  --url https://api.mountsea.ai/producer/tasks \
  --header 'Authorization: Bearer <token>'
{
  "taskId": "<string>",
  "status": "pending",
  "result": {},
  "errorMessage": "<string>",
  "errorCode": 123,
  "finishedAt": "2023-11-07T05:31:56Z",
  "createdAt": "2023-11-07T05:31:56Z",
  "traceId": "<string>"
}
所有异步端点(audios、upload、stems、download、download-video)都会返回一个 taskId。使用此端点轮询,直到任务达到终态(completedfailedtimeout)。

任务状态值

状态描述
pending任务排队中
ready任务准备就绪,等待处理
assigned任务已分配给工作节点
processing任务处理中
completed任务完成 — 查看 result 获取数据
failed任务失败 — 查看 errorMessage
cancelled任务已取消
timeout任务超时
建议使用 3-5 秒的轮询间隔。音乐生成通常需要 30-120 秒,具体取决于曲目时长。

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

查询参数

taskId
string
必填

任务ID

响应

200 - application/json

任务状态

taskId
string
必填

任务 ID

status
enum<string>
必填

任务状态

可用选项:
pending,
ready,
assigned,
processing,
completed,
failed,
cancelled,
timeout
result
object

任务结果(直接透传协议层返回,类型根据任务类型不同而变化)

errorMessage
string

错误信息

errorCode
number

错误代码

finishedAt
string<date-time>

完成时间

createdAt
string<date-time>

创建时间

traceId
string

追踪 ID