> ## Documentation Index
> Fetch the complete documentation index at: https://docs.toapis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Music Generation

> Suno music generation with inspiration and custom-lyrics modes, optional Max tier

* Generate full songs from a text description or custom lyrics (2 candidates per request)
* Asynchronous task; poll by task ID
* `custom` determines the meaning of `prompt`: custom lyrics vs inspiration description

## Authorizations

**Authorization** `string` *required*

Bearer Token. Get your API Key: [API Key management](https://toapis.com/console/token)

## Body

**model** `string` *required*

Fixed value `"suno"`

**custom** `boolean`

Mode switch, default `false`

* `false`: inspiration mode — `gpt_description` (or `prompt`) describes the music
* `true`: custom lyrics mode — `prompt` is the lyrics text; `title`/`style`/`negative_tags` apply

**gpt\_description** `string`

Music description in inspiration mode, e.g. `"lo-fi jazz for a rainy café"`. Not used in custom mode.

**prompt** `string`

Lyrics text in custom mode (supports `[Verse]`/`[Chorus]` structure tags)

**title** `string`

Song title (custom mode)

**style** `string`

Style tags (custom mode), e.g. `"dreamy synthwave, female vocal"`

**negative\_tags** `string`

Elements to avoid (custom mode)

**instrumental** `boolean`

Generate instrumental-only music

**version** `string`

Engine version: `v6` / `v6-wild` / `v6-mini`

**max\_mode** `boolean`

Max quality tier, billed at 2× (\$0.10). Requires `custom=true`

**persona\_id** `string`

Reuse a created vocal persona. Mutually exclusive with `custom_model_id`

**custom\_model\_id** `string`

Use a custom-trained model. Mutually exclusive with `version` and `persona_id`

### Optional tuning parameters

`style_weight`, `weirdness`, `audio_weight`, `vocal_gender`, `auto_lyrics`, `variety` are all optional; upstream defaults apply when omitted.

## Response

**task\_id** `string`

Task ID (`tsk_aud_` prefix); poll via [music task status](https://docs.toapis.com/docs/en/api-reference/tasks/music-status.md)

**status** `string`

Initial status: `submitted` / `queued` / `in_progress`

On completion, `result.music[]` returns 2 candidates, each with `audio_url`, `image_url`, `title`, `tags`, `lyrics`, `duration`. Media URLs are mirrored to our CDN.

```bash cURL theme={null}
curl --request POST \
  --url https://toapis.com/v1/music/generations/generation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "suno",
    "gpt_description": "lo-fi jazz for a rainy café",
    "instrumental": false,
    "version": "v6"
  }'
```

```python Python theme={null}
import requests

resp = requests.post(
    "https://toapis.com/v1/music/generations/generation",
    headers={"Authorization": "Bearer <token>"},
    json={
        "model": "suno",
        "custom": True,
        "prompt": "[Verse]\nNeon lights are glowing\n[Chorus]\nWe ride until the morning",
        "title": "Neon Ride",
        "style": "synthwave",
        "max_mode": True
    }
)
print(resp.json())
```

```javascript JavaScript theme={null}
const resp = await fetch("https://toapis.com/v1/music/generations/generation", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    model: "suno",
    gpt_description: "dreamy synthwave with female vocals",
    version: "v6-wild"
  })
});
console.log(await resp.json());
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.