跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt

Use this file to discover all available pages before exploring further.

轮询此端点以检查音乐生成任务的状态。
如果该任务已不存在或无法再通过公开的异步任务契约解析,TokenLab 会返回 async_task_not_found,并附带消息 Task not found or no longer available.

路径参数

id
string
必填
音乐生成任务 ID。

响应

id
string
任务 ID。
status
string
任务状态:pendingprocessingcompletedfailed
progress
integer
进度百分比 (0-100)。
audio_url
string
音频文件的下载 URL(完成时)。
video_url
string
带可视化效果的视频版本 URL(完成时)。
title
string
生成的歌曲标题。
lyrics
string
生成或提供的歌词。
error
string
错误信息(失败时)。
curl "https://api.tokenlab.sh/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
  -H "Authorization: Bearer sk-your-api-key"
{
  "id": "ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "task_id": "ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "poll_url": "/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "status": "completed",
  "audio_url": "https://cdn.example.com/music/abc123.mp3",
  "video_url": "https://cdn.example.com/music/abc123.mp4",
  "title": "Night Drive",
  "lyrics": "[Verse 1]\nDriving through the night..."
}