Custom Generate Audio Endpoint

Overview

Generates audio with advanced customization options including tags, title, and negative tags. Provides more control over the generation process than the basic generate endpoint.

🔗 Quick Links

Endpoint

POST /api/custom_generate
POST /[accountId]/api/custom_generate

Request

Headers

Content-Type: application/json

Body (JSON)

prompt (string, required)
Text prompt describing the music to generate

tags (string, optional)
Style/genre tags (comma-separated)

title (string, optional)
Title for the generated song

make_instrumental (boolean, optional, default: false)
Whether to generate instrumental music

model (string, optional, default: "chirp-crow")
Model to use for generation

wait_audio (boolean, optional, default: false)
Whether to wait for audio to be fully generated

negative_tags (string, optional)
Negative tags to avoid (comma-separated)

Example Request

curl -X POST https://your-domain.com/api/custom_generate \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A energetic rock song",
    "tags": "rock, energetic, guitar",
    "title": "Rock Anthem",
    "make_instrumental": false,
    "model": "chirp-crow",
    "wait_audio": true,
    "negative_tags": "slow, sad"
  }'
const response = await fetch('/api/custom_generate', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    prompt: 'A energetic rock song',
    tags: 'rock, energetic, guitar',
    title: 'Rock Anthem',
    negative_tags: 'slow, sad',
    wait_audio: true
  })
});

Response

Success Response (200 OK)

Returns an array of AudioInfo objects:

[
  {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "title": "Rock Anthem",
    "image_url": "https://cdn.suno.ai/image-12345.png",
    "lyric": "A energetic rock song",
    "audio_url": "https://cdn.suno.ai/audio-12345.mp3",
    "video_url": "https://cdn.suno.ai/video-12345.mp4",
    "created_at": "2025-12-09T14:30:00.000Z",
    "model_name": "chirp-crow",
    "status": "complete",
    "gpt_description_prompt": "A energetic rock song",
    "prompt": "A energetic rock song",
    "type": "music",
    "tags": "rock, energetic, guitar",
    "negative_tags": "slow, sad",
    "duration": "180"
  }
]

Status Code: 200
Content-Type: application/json

Error Response

Returns the error from Suno API or a generic error:

{
  "error": "[error message from Suno API]"
}

Status Code: 402 (Payment Required) or 500 (Internal Server Error)
Content-Type: application/json

Method Not Allowed (405)

When using an unsupported HTTP method:

Status Code: 405
Headers: Allow: POST

Notes

  • This endpoint has a longer timeout (60 seconds) to accommodate wait_audio: true
  • Tags and negative_tags should be comma-separated strings
  • All responses include CORS headers