跳转到主要内容
GET
/
eleven
/
tasks
查询任务状态
curl --request GET \
  --url https://api.mountsea.ai/eleven/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>"
}
所有异步端点(music、plan、video-to-music、stems、upload)都返回 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 (eleven-xxxxxxxx-...)

响应

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