> ## 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

<ParamField header="Authorization" type="string" required>
  Bearer Token. Get your API Key: [API Key management](https://toapis.com/console/token)
</ParamField>

## Body

<ParamField body="model" type="string" required>
  Fixed value `"suno"`
</ParamField>

<ParamField body="custom" type="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
</ParamField>

<ParamField body="gpt_description" type="string">
  Music description in inspiration mode, e.g. `"lo-fi jazz for a rainy café"`. Not used in custom mode.
</ParamField>

<ParamField body="prompt" type="string">
  Lyrics text in custom mode (supports `[Verse]`/`[Chorus]` structure tags)
</ParamField>

<ParamField body="title" type="string">
  Song title (custom mode)
</ParamField>

<ParamField body="style" type="string">
  Style tags (custom mode), e.g. `"dreamy synthwave, female vocal"`
</ParamField>

<ParamField body="negative_tags" type="string">
  Elements to avoid (custom mode)
</ParamField>

<ParamField body="instrumental" type="boolean">
  Generate instrumental-only music
</ParamField>

<ParamField body="version" type="string">
  Engine version: `v6` / `v6-wild` / `v6-mini`
</ParamField>

<ParamField body="max_mode" type="boolean">
  Max quality tier, billed at 2× (\$0.10). Requires `custom=true`
</ParamField>

<ParamField body="persona_id" type="string">
  Reuse a created vocal persona. Mutually exclusive with `custom_model_id`
</ParamField>

<ParamField body="custom_model_id" type="string">
  Use a custom-trained model. Mutually exclusive with `version` and `persona_id`
</ParamField>

### Optional tuning parameters

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

## Response

<ResponseField name="task_id" type="string">
  Task ID (`tsk_aud_` prefix); poll via [music task status](/docs/en/api-reference/tasks/music-status)
</ResponseField>

<ResponseField name="status" type="string">
  Initial status: `submitted` / `queued` / `in_progress`
</ResponseField>

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

<RequestExample>
  ```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());
  ```
</RequestExample>


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