Skip to content

查询:单个任务

简洁描述:查询单个 Suno 音乐或歌词生成任务的详细状态和结果。


概览

  • 请求方法:GET
  • 路径:/suno/fetch/{task_id}
  • 内容类型:application/json

认证方式

  • Header:Authorization: Bearer <token>

请求示例

路径参数

参数类型必填描述
task_idstring任务 ID,例如 2a145658-3342-4228-b779-b8323a2b77df

curl 示例

bash
curl -X GET "https://api.gpt.ge/suno/fetch/2a145658-3342-4228-b779-b8323a2b77df" \
  -H "Authorization: Bearer sk-xxxx"

JavaScript (fetch) 示例

javascript
fetch('https://api.gpt.ge/suno/fetch/2a145658-3342-4228-b779-b8323a2b77df', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer sk-xxxx'
  }
}).then(r => r.json()).then(console.log);

Python (requests) 示例

python
import requests

response = requests.get(
    'https://api.gpt.ge/suno/fetch/2a145658-3342-4228-b779-b8323a2b77df',
    headers={'Authorization': 'Bearer sk-xxxx'}
)
print(response.json())

返回示例(200)

json
{
  "code": "success",
  "message": "",
  "data": {
    "task_id": "2a145658-3342-4228-b779-b8323a2b77df",
    "action": "MUSIC",
    "status": "SUCCESS",
    "fail_reason": "",
    "submit_time": 1726911801,
    "start_time": 1726911812,
    "finish_time": 1726911897,
    "progress": "100%",
    "data": [
      {
        "id": "3435e194-50e7-4edc-9442-bffe072fccfc",
        "title": "快乐周末",
        "handle": "yellowrobots6855",
        "status": "complete",
        "user_id": "ee5e241a-ead6-435d-bea8-526c77c04c72",
        "is_liked": false,
        "metadata": {
          "tags": "heartfelt salsa",
          "type": "gen",
          "prompt": "",
          "stream": true,
          "history": null,
          "duration": 128.92,
          "error_type": null,
          "error_message": null,
          "concat_history": null,
          "refund_credits": false,
          "audio_prompt_id": null,
          "gpt_description_prompt": null
        },
        "reaction": null,
        "audio_url": "https://cdn1.suno.ai/3435e194-50e7-4edc-9442-bffe072fccfc.mp3",
        "image_url": "https://cdn2.suno.ai/image_3435e194-50e7-4edc-9442-bffe072fccfc.jpeg",
        "is_public": false,
        "video_url": "https://cdn1.suno.ai/3435e194-50e7-4edc-9442-bffe072fccfc.mp4",
        "created_at": "2024-09-21T09:43:21.637Z",
        "is_trashed": false,
        "model_name": "chirp-v3",
        "play_count": 0,
        "display_name": "YellowRobots6855",
        "upvote_count": 0,
        "image_large_url": "https://cdn2.suno.ai/image_large_3435e194-50e7-4edc-9442-bffe072fccfc.jpeg",
        "is_video_pending": false,
        "is_handle_updated": false,
        "major_model_version": "v3.5"
      }
    ]
  }
}

注意:此接口用于查询单个 Suno 任务详情,返回任务状态、进度、结果数据及媒体链接。