ToAPIsToAPIs
Suno 音楽

音楽生成

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

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

Authorizations

Authorizationstringヘッダー必須

Bearer Token。API Key:API Key 管理ページ

Body

modelstringボディ必須
固定値 "suno"
custombooleanボディ

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

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

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

promptstringボディ

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

titlestringボディ
曲タイトル(カスタムモード)
stylestringボディ
スタイルタグ(カスタムモード)。例:"dreamy synthwave, female vocal"
negative_tagsstringボディ
避けたい要素(カスタムモード)
instrumentalbooleanボディ
インストゥルメンタル生成
versionstringボディ
エンジン版:v6 / v6-wild / v6-mini
max_modebooleanボディ
Max 品質ティア(2倍料金 $0.10)。custom=true が必要
persona_idstringボディ
作成済みペルソナ ID。custom_model_id と排他
custom_model_idstringボディ
カスタム学習モデル ID。version・persona_id と排他

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

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

Response

task_idstring

タスク ID(tsk_aud_ プレフィックス)。タスク状態照会 でポーリング

statusstring
submitted / queued / in_progress

完了後 result.music[] に 2 候補が返り、各 audio_url、image_url、title、tags、lyrics、duration を含みます。メディア URL は CDN にミラー済みです。

リクエスト例

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"
  }'
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())
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());