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

# 音楽生成

> Suno 音楽生成。インスピレーション/カスタム歌詞モード、Max ティア対応

* テキスト説明またはカスタム歌詞から楽曲を生成(1回につき2候補)
* 非同期タスク。タスク ID で結果をポーリング
* `custom` が `prompt` の意味を決定:カスタム歌詞 vs インスピレーション説明

## Authorizations

**Authorization** `string` *required*

Bearer Token。API Key:[API Key 管理ページ](https://toapis.com/console/token)

## Body

**model** `string` *required*

固定値 `"suno"`

**custom** `boolean`

モード切替。デフォルト `false`

* `false`:インスピレーションモード — `gpt_description`(または `prompt`)に楽曲の説明
* `true`:カスタム歌詞モード — `prompt` が歌詞本文、`title`/`style`/`negative_tags` が有効

**gpt\_description** `string`

インスピレーションモードの楽曲説明。例:`"雨の夜のカフェに合う lo-fi"`。カスタムモードでは不要

**prompt** `string`

カスタムモードの歌詞本文(`[Verse]`/`[Chorus]` 構造タグ対応)

**title** `string`

曲タイトル(カスタムモード)

**style** `string`

スタイルタグ(カスタムモード)。例:`"dreamy synthwave, female vocal"`

**negative\_tags** `string`

避けたい要素(カスタムモード)

**instrumental** `boolean`

インストゥルメンタル生成

**version** `string`

エンジン版:`v6` / `v6-wild` / `v6-mini`

**max\_mode** `boolean`

Max 品質ティア(2倍料金 \$0.10)。`custom=true` が必要

**persona\_id** `string`

作成済みペルソナ ID。`custom_model_id` と排他

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

カスタム学習モデル ID。`version`・`persona_id` と排他

### オプションの調整パラメータ

`style_weight`、`weirdness`、`audio_weight`、`vocal_gender`、`auto_lyrics`、`variety` はすべて省略可(省略時は上流の既定値)。

## Response

**task\_id** `string`

タスク ID(`tsk_aud_` プレフィックス)。[タスク状態照会](https://docs.toapis.com/docs/ja/api-reference/tasks/music-status.md) でポーリング

**status** `string`

`submitted` / `queued` / `in_progress`

完了後 `result.music[]` に 2 候補が返り、各 `audio_url`、`image_url`、`title`、`tags`、`lyrics`、`duration` を含みます。メディア URL は 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 ジャズ",
    "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]\nネオンが灯る\n[Chorus]\n夜明けまで駆け抜ける",
        "title": "ネオンライド",
        "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.