Skip to content

查询任务

查询歌曲生成任务的信息。

接口信息

  • 方法: GET
  • 路径: /api/v1/music?action=song_query&task_id={task_id}
  • 功能: 查询歌曲任务状态

认证

BearerAuth Type: HTTP (bearer)

请求参数

参数类型必填说明
task_idstring任务 ID

响应

响应示例 (进行中)

json
{
  "code": 0,
  "message": "success",
  "data": {
    "task_id": "task_1234567890abcdef",
    "created_at": 1640995200,
    "finished_at": 0,
    "model": "mureka-7.5",
    "status": "running",
    "failed_reason": "",
    "watermarked": false,
    "progress": 65,
    "choices": []
  }
}

响应示例 (完成)

json
{
  "code": 0,
  "message": "success",
  "resp_data": {
    "task_id": "task_1234567890abcdef",
    "created_at": 1640995200,
    "finished_at": 1640995680,
    "model": "mureka-7.5",
    "status": "succeeded",
    "failed_reason": "",
    "watermarked": false,
    "progress": 100,
    "choices": [
      {
        "index": 0,
        "id": "song_1234567890abcdef",
        "url": "https://example.com/audio/song_1234567890abcdef.mp3",
        "flac_url": "https://example.com/audio/song_1234567890abcdef.flac",
        "stream_url": "",
        "duration": 240000,
        "lyrics_sections": [
          {
            "section_type": "verse",
            "start": 0,
            "end": 30000,
            "lines": [
              {
                "start": 0,
                "end": 15000,
                "text": "青春如花绽放",
                "words": [
                  {
                    "start": 0,
                    "end": 5000,
                    "text": "青春"
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}

请求示例

bash
curl -X GET "[HOST]/api/v1/music?action=song_query&task_id=task_1234567890abcdef" \
  -H "Authorization: Bearer YOUR_API_KEY"