Suno 音楽フォーマット(Music)
Suno 音楽フォーマット(Music)
Section titled “Suno 音楽フォーマット(Music)”本ページの概要
ご注意ください
このインターフェースは Suno 公式のものではなく、作者 柏拉图 のオープンソースプロジェクト Suno-API をベースに実装された Suno のプロキシ API です。
作者の貢献に心から感謝します。おかげで Suno の強力な機能を手軽に利用できるようになりました。時間があれば、ぜひ作者に Star をお願いします。
Suno Music API では、音楽の生成や処理に関するさまざまな機能を提供しています。たとえば:
- プロンプトに基づく楽曲生成(インスピレーションモード、自動作成モード)
- 既存楽曲の続編生成
- 複数の音声クリップの結合
- 歌詞生成
- 音声アップロード
API を使うことで、AI 音楽生成機能をアプリケーションに簡単に組み込めます。
💡 リクエスト例
Section titled “💡 リクエスト例”楽曲生成 ✅
Section titled “楽曲生成 ✅”curl --location 'https://4All API地址/suno/submit/music' \--header 'Authorization: Bearer $NEWAPI_API_KEY' \--header 'Content-Type: application/json' \--data '{ "prompt":"[Verse]\nWalking down the streets\nBeneath the city lights\nNeon signs flickering\nLighting up the night\nHeart beating faster\nLike a drum in my chest\nI'\''m alive in this moment\nFeeling so blessed\n\nStilettos on the pavement\nStepping with grace\nSurrounded by the people\nMoving at their own pace\nThe rhythm of the city\nIt pulses in my veins\nLost in the energy\nAs my worries drain\n\n[Verse 2]\nConcrete jungle shining\nWith its dazzling glow\nEvery corner hiding secrets that only locals know\nA symphony of chaos\nBut it'\''s music to my ears\nThe hustle and the bustle\nWiping away my fears", "tags":"emotional punk", "mv":"chirp-v4", "title":"City Lights"}'レスポンス例:
{ "code":"success", "message":"", "data":"736a6f88-bd29-4b1e-b110-37132a5325ac"}歌詞生成 ✅
Section titled “歌詞生成 ✅”curl --location 'https://4All API地址/suno/submit/lyrics' \--header 'Authorization: Bearer $NEWAPI_API_KEY' \--header 'Content-Type: application/json' \--data '{ "prompt":"dance"}'レスポンス例:
{ "code":"success", "message":"", "data":"736a6f88-bd29-4b1e-b110-37132a5325ac"}音声アップロード ❌
Section titled “音声アップロード ❌”curl --location 'https://4All API地址/suno/uploads/audio-url' \--header 'Authorization: Bearer $NEWAPI_API_KEY' \--header 'Content-Type: application/json' \--data '{ "url":"http://cdnimg.example.com/ai/2024-06-18/d416d9c3c34eb22c7d8c094831d8dbd0.mp3"}'レスポンス例:
{ "code":"success", "message":"", "data":"736a6f88-bd29-4b1e-b110-37132a5325ac"}楽曲結合 ❌
Section titled “楽曲結合 ❌”curl --location 'https://4All API地址/suno/submit/concat' \--header 'Authorization: Bearer $NEWAPI_API_KEY' \--header 'Content-Type: application/json' \--data '{ "clip_id":"extend 后的 歌曲ID", "is_infill": false}'レスポンス例:
{ "code":"success", "message":"", "data":"736a6f88-bd29-4b1e-b110-37132a5325ac"}タスク状態の確認 ✅
Section titled “タスク状態の確認 ✅”curl --location 'https://4All API地址/suno/fetch' \--header 'Authorization: Bearer $NEWAPI_API_KEY' \--header 'Content-Type: application/json' \--data '{ "ids":["task_id"], "action":"MUSIC"}'レスポンス例:
{ "code":"success", "message":"", "data":[ { "task_id":"346c5d10-a4a1-4f49-a851-66a7dae6cfaf", "notify_hook":"", "action":"MUSIC", "status":"IN_PROGRESS", "fail_reason":"", "submit_time":1716191749, "start_time":1716191786, "finish_time":0, "progress":"0%", "data":[ { "id":"e9893d04-6a63-4007-8473-64b706eca4d1", "title":"Electric Dance Party", "status":"streaming", "metadata":{ "tags":"club banger high-energy edm", "prompt":"略", "duration":null, "error_type":null, "error_message":null, "audio_prompt_id":null, "gpt_description_prompt":"miku dance" }, "audio_url":"https://audiopipe.suno.ai/?item_id=e9893d04-6a63-4007-8473-64b706eca4d1", "image_url":"https://cdn1.suno.ai/image_e9893d04-6a63-4007-8473-64b706eca4d1.png", "video_url":"", "model_name":"chirp-v3", "image_large_url":"https://cdn1.suno.ai/image_large_e9893d04-6a63-4007-8473-64b706eca4d1.png", "major_model_version":"v3" } ] } ]}curl --location 'https://4All API地址/suno/fetch/{{task_id}}' \--header 'Authorization: Bearer $NEWAPI_API_KEY'レスポンス例:
{ "code":"success", "message":"", "data":{ "task_id":"f4a94d75-087b-4bb1-bd45-53ba293faf96", "notify_hook":"", "action":"LYRICS", "status":"SUCCESS", "fail_reason":"", "submit_time":1716192124, "start_time":1716192124, "finish_time":1716192124, "progress":"100%", "data":{ "id":"f4a94d75-087b-4bb1-bd45-53ba293faf96", "text":"略", "title":"Electric Fantasy", "status":"complete" } }}📮 リクエスト
Section titled “📮 リクエスト”すべてのリクエストには、ヘッダーに認証情報を含める必要があります:
Authorization: Bearer $NEWAPI_API_KEYエンドポイント
Section titled “エンドポイント”POST /suno/submit/music新しい楽曲を生成します。インスピレーションモード、自動作成モード、続編生成に対応しています。
POST /suno/submit/lyricsプロンプトに基づいて歌詞を生成します。
音声アップロード
Section titled “音声アップロード”POST /suno/uploads/audio-url音声ファイルをアップロードします。
POST /suno/submit/concat複数の音声クリップを結合して、1 曲の完成版を作成します。
タスク状態の一括照会
Section titled “タスク状態の一括照会”POST /suno/fetch複数タスクの状態と結果を一括で取得します。
単一タスクの状態照会
Section titled “単一タスクの状態照会”GET /suno/fetch/{{task_id}}単一タスクの状態と結果を取得します。
リクエストボディのパラメータ
Section titled “リクエストボディのパラメータ”prompt
Section titled “prompt”- 種類:String
- 必須:インスピレーションモードでは不要、自動作成モードでは必須
- 説明:歌詞の内容。自動作成モードでは指定が必要です
- 種類:String
- 必須:いいえ
- 説明:モデルバージョン。選択肢:chirp-v3-0、chirp-v3-5。デフォルトは chirp-v3-0
- 種類:String
- 必須:インスピレーションモードでは不要、自動作成モードでは必須
- 説明:楽曲タイトル。自動作成モードでは指定が必要です
- 種類:String
- 必須:インスピレーションモードでは不要、自動作成モードでは必須
- 説明:楽曲のスタイルタグ。カンマ区切りで指定します。自動作成モードでは指定が必要です
make_instrumental
Section titled “make_instrumental”- 種類:Boolean
- 必須:いいえ
- 説明:インストゥルメンタルを生成するかどうか。true でインストゥルメンタルを生成します
task_id
Section titled “task_id”- 種類:String
- 必須:続編生成時に必須
- 説明:続編を作成する対象の楽曲のタスク ID
continue_at
Section titled “continue_at”- 種類:Float
- 必須:続編生成時に必須
- 説明:曲の何秒目から続編を生成するか
continue_clip_id
Section titled “continue_clip_id”- 種類:String
- 必須:続編生成時に必須
- 説明:続編を作成する対象の楽曲の clip ID
gpt_description_prompt
Section titled “gpt_description_prompt”- 種類:String
- 必須:インスピレーションモードでは必須、その他のモードでは不要
- 説明:インスピレーションの元になるテキスト説明
notify_hook
Section titled “notify_hook”- 種類:String
- 必須:いいえ
- 説明:楽曲生成完了時のコールバック通知先 URL
prompt
Section titled “prompt”- 種類:String
- 必須:はい
- 説明:歌詞のテーマまたはキーワード
notify_hook
Section titled “notify_hook”- 種類:String
- 必須:いいえ
- 説明:歌詞生成完了時のコールバック通知先 URL
音声アップロード
Section titled “音声アップロード”- 種類:String
- 必須:はい
- 説明:アップロードする音声ファイルの URL
clip_id
Section titled “clip_id”- 種類:String
- 必須:はい
- 説明:結合する楽曲クリップの ID
is_infill
Section titled “is_infill”- 種類:Boolean
- 必須:いいえ
- 説明:補完モードかどうか
- 種類:String
- 必須:はい
- 説明:照会対象のタスク ID 一覧
action
Section titled “action”- 種類:String
- 必須:いいえ
- 説明:タスク種別。選択肢:MUSIC、LYRICS
📥 レスポンス
Section titled “📥 レスポンス”すべての API は共通の JSON 形式でレスポンスを返します:
{ "code":"success", "message":"", "data":"{{RESULT}}"}成功レスポンス
Section titled “成功レスポンス”基本レスポンス項目
Section titled “基本レスポンス項目”- 種類:String
- 説明:リクエスト状態。success は成功を表します
message
Section titled “message”- 種類:String
- 説明:リクエスト失敗時のエラーメッセージ
- 種類:各 API により異なる
- 説明:リクエスト成功時の返却データ
- 楽曲生成、歌詞生成、音声アップロード、楽曲結合 API:タスク ID の文字列を返します
- タスク照会 API:タスクオブジェクト、またはタスクオブジェクト配列を返します
タスク関連オブジェクト
Section titled “タスク関連オブジェクト”タスクオブジェクト
Section titled “タスクオブジェクト”task_id
Section titled “task_id”- 種類:String
- 説明:タスク ID
notify_hook
Section titled “notify_hook”- 種類:String
- 説明:タスク完了後のコールバック通知先 URL
action
Section titled “action”- 種類:String
- 説明:タスク種別。選択肢:MUSIC、LYRICS
status
Section titled “status”- 種類:String
- 説明:タスク状態。選択肢:IN_PROGRESS、SUCCESS、FAIL
fail_reason
Section titled “fail_reason”- 種類:String
- 説明:タスク失敗の理由
submit_time
Section titled “submit_time”- 種類:Integer
- 説明:タスク送信時刻のタイムスタンプ
start_time
Section titled “start_time”- 種類:Integer
- 説明:タスク開始時刻のタイムスタンプ
finish_time
Section titled “finish_time”- 種類:Integer
- 説明:タスク終了時刻のタイムスタンプ
progress
Section titled “progress”- 種類:String
- 説明:タスク進捗のパーセンテージ
- 種類:タスク種別により異なる
- 説明:
- 音楽生成タスク:楽曲オブジェクトの配列
- 歌詞生成タスク:歌詞オブジェクト
楽曲オブジェクト
Section titled “楽曲オブジェクト”- 種類:String
- 説明:楽曲 ID
- 種類:String
- 説明:楽曲タイトル
status
Section titled “status”- 種類:String
- 説明:楽曲ステータス
metadata
Section titled “metadata”- 種類:Object
- 説明:楽曲メタデータ
- tags:楽曲のスタイルタグ
- prompt:楽曲生成に使用した歌詞
- duration:楽曲の長さ
- error_type:エラー種別
- error_message:エラーメッセージ
- audio_prompt_id:音声 prompt ID
- gpt_description_prompt:インスピレーションの元になる説明
audio_url
Section titled “audio_url”- 種類:String
- 説明:楽曲音声の URL
image_url
Section titled “image_url”- 種類:String
- 説明:楽曲カバー画像の URL
video_url
Section titled “video_url”- 種類:String
- 説明:楽曲動画の URL
model_name
Section titled “model_name”- 種類:String
- 説明:楽曲生成に使用したモデル名
major_model_version
Section titled “major_model_version”- 種類:String
- 説明:モデルのメジャーバージョン
歌詞オブジェクト
Section titled “歌詞オブジェクト”- 種類:String
- 説明:歌詞 ID
- 種類:String
- 説明:歌詞の内容
- 種類:String
- 説明:歌詞タイトル
status
Section titled “status”- 種類:String
- 説明:歌詞ステータス
🌟 ベストプラクティス
Section titled “🌟 ベストプラクティス”- 歌や歌詞の生成プロンプトは、できるだけ具体的で詳細に指定し、曖昧すぎる表現は避ける
- タスク状態を確認する際のポーリング間隔は 2〜5 秒程度が推奨。頻繁すぎる問い合わせは避ける
- インスピレーションモードでは gpt_description_prompt のみを指定すればよく、API が歌詞・タイトル・タグなどを自動生成します
- 自動作成モードでは prompt、title、tags を指定することで、楽曲をより細かく制御できます
- 可能であれば最新バージョンのモデル(例: chirp-v4)を使うと、より良い結果が得られます
- コールバック通知機能(notify_hook パラメータ)を使うと、ポーリング頻度を下げて効率を高められます
- 音楽の続編生成や結合機能を使うことで、既存の音楽をベースに、より豊かで完成度の高い作品を作れます
- ネットワークタイムアウトやパラメータ検証失敗など、発生しうる例外やエラーへの対処を忘れないでください