Skip to content

Query: Batch Task

Short description: Batch query Suno music or lyrics generation task status and results.


Overview

  • Method: POST
  • Path: /suno/fetch
  • Content-Type: application/json

Authentication

  • Header: Authorization: Bearer <token>

Request Example

Request Body Parameters

ParameterTypeRequiredDescription
idsarrayYesList of task IDs
actionstringNoTask type, MUSIC for songs, LYRICS for lyrics

curl Example

bash
curl -X POST "https://api.gpt.ge/suno/fetch" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-xxxx" \
  -d '{
    "ids": [
      "2a145658-3342-4228-b779-b8323a2b77df1",
      "2a145658-3342-4228-b779-b8323a2b77df2"
    ],
    "action": "MUSIC"
  }'

JavaScript (fetch) Example

javascript
fetch('https://api.gpt.ge/suno/fetch', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer sk-xxxx'
  },
  body: JSON.stringify({
    ids: [
      '2a145658-3342-4228-b779-b8323a2b77df1',
      '2a145658-3342-4228-b779-b8323a2b77df2'
    ],
    action: 'MUSIC'
  })
}).then(r => r.json()).then(console.log);

Python (requests) Example

python
import requests

response = requests.post(
    'https://api.gpt.ge/suno/fetch',
    headers={
        'Content-Type': 'application/json',
        'Authorization': 'Bearer sk-xxxx'
    },
    json={
        'ids': [
            '2a145658-3342-4228-b779-b8323a2b77df1',
            '2a145658-3342-4228-b779-b8323a2b77df2'
        ],
        'action': 'MUSIC'
    }
)
print(response.json())

Response Example (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": "Happy Weekend",
          "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"
        }
      ]
    }
  ]
}

Note: This endpoint is used to batch query Suno tasks. You can filter song or lyrics tasks by ids and optional action.