Suno 音声ステム分離
音声ステム分離エンドポイントを使用して、非同期タスクを作成します。
概要
必要な入力で音声ステム分離エンドポイントを使用します。返されたタスクIDを使用してその状態を取得するか、以下に記載されている配信のために callback_url を指定してください。
クイックスタート
- APIキーを作成し、RUNAPI_API_KEYとして設定します。
- 本文がリクエストスキーマと一致するPOSTリクエストを送信します。
- 返されたタスクIDを保存し、終了状態になるまでポーリングするか、以下に記載されているコールバックを処理してください。
エンドポイント
- ベースURL
https://runapi.ai- API バージョン
v1- 認証
Authorization: Bearer YOUR_API_TOKEN
サポートされているモデル
現在の料金、レート制限、商用利用の詳細については、モデルページを開いてください。
リクエストスキーマ
ドキュメントに記載されたフィールドのみを送信してください。callback_urlが指定された場合、以下に記載されたタスク配信を受信します。
リクエストボディフィールド5件
audio_idstringソースタスク内のオーディオ ID。
callback_urlstring非同期通知用のWebhook URL。
stem_namestring高度な分離のターゲットステム。typeがsplit_stem_advancedの場合は必須です。
許可される値:Lead Vocal, Drum Kit, Kick, Snare, Risers, Bass, Backing Vocals, Piano, Electric Guitar, Percussion, String Section, Synth, Acoustic Guitar, Sound Effects, Synth Pad, Synth Bass, Guitar, Brass Section, Organ, Electronic Drum Kit, Lead Electric Guitar, Synth Keys, Rhythm Electric Guitar, Electric Piano, Upright Bass, Keyboards, Distorted Electric Guitar, Synth Strings, Synth Lead, Woodwinds, Rhythm Acoustic Guitar, Flute, Harp, Tambourine, Trumpet, Arpeggiator, Accordion, Fiddle, Pedal Steel Guitar, Synth Voice, Violin, Digital Piano, Synth Brass, Mandolin, Choir, Banjo, Bells, Clarinet, Tenor Saxophone, Trombone, Shaker, French Horn, Glockenspiel, Electric Bass, Cello, Timpani, Harmonica, Marimba, Vibraphone, Lap Steel Guitar, Saxophone, Orchestra, Horns, Cymbals, Hand Clap, Oboe, Celesta, Congas, Drone, Alto Saxophone, Double Bass, Ukulele, Harpsichord, Baritone Saxophone, Xylophone, Tuba, Bass Guitar, Whistle, Lead Guitar, Rhodes, 808, Bongos, Bassoon, Cowbell, Viola, Sitar, Steel Drums, Piccolo, Theremin, Bagpipes, Hi-Hat, Music Box, Melodica, Tabla, Koto, Djembe, Taiko, Didgeridoo
task_idstringソースタスクID。
typestringステム分離モード。
許可される値:separate_vocal, split_stem, split_stem_advanced
デフォルト: separate_vocal
条件付きルール
これらの要件は、列挙されたすべての条件が一致する場合に適用されます。
-
条件
type = split_stem_advanced- 必須
stem_name- 使用不可
承認を作成する
POST /api/v1/suno/separate_audio_stems
レスポンススキーマ
{
"properties": {
"billing": {
"properties": {
"refund": {
"oneOf": [
{
"properties": {
"refunded_at": {
"type": "string"
}
},
"required": [
"refunded_at"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"reservation": {
"oneOf": [
{
"properties": {
"amount_cents": {
"type": "integer"
}
},
"required": [
"amount_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"settlement": {
"oneOf": [
{
"properties": {
"amount_micro_cents": {
"type": "integer"
},
"charged_amount_cents": {
"type": "integer"
}
},
"required": [
"charged_amount_cents",
"amount_micro_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
}
},
"required": [
"reservation",
"settlement",
"refund"
],
"type": "object",
"unevaluatedProperties": false
},
"id": {
"type": "string"
},
"status": {
"enum": [
"processing"
],
"type": "string"
},
"task_replayed": {
"type": "boolean"
}
},
"required": [
"id",
"status",
"billing"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "processing"
}
ポーリング処理中
GET /api/v1/suno/separate_audio_stems/:id
レスポンススキーマ
{
"properties": {
"billing": {
"properties": {
"refund": {
"oneOf": [
{
"properties": {
"refunded_at": {
"type": "string"
}
},
"required": [
"refunded_at"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"reservation": {
"oneOf": [
{
"properties": {
"amount_cents": {
"type": "integer"
}
},
"required": [
"amount_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"settlement": {
"oneOf": [
{
"properties": {
"amount_micro_cents": {
"type": "integer"
},
"charged_amount_cents": {
"type": "integer"
}
},
"required": [
"charged_amount_cents",
"amount_micro_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
}
},
"required": [
"reservation",
"settlement",
"refund"
],
"type": "object",
"unevaluatedProperties": false
},
"id": {
"type": "string"
},
"separated_audios": {
"properties": {
"backing_vocals_url": {
"type": "string",
"x-runapi-generated-media": true
},
"bass_url": {
"type": "string",
"x-runapi-generated-media": true
},
"brass_url": {
"type": "string",
"x-runapi-generated-media": true
},
"drums_url": {
"type": "string",
"x-runapi-generated-media": true
},
"fx_url": {
"type": "string",
"x-runapi-generated-media": true
},
"guitar_url": {
"type": "string",
"x-runapi-generated-media": true
},
"instrumental_url": {
"type": "string",
"x-runapi-generated-media": true
},
"keyboard_url": {
"type": "string",
"x-runapi-generated-media": true
},
"pairs": {
"items": {
"properties": {
"extracted_audio": {
"properties": {
"audio_url": {
"type": "string",
"x-runapi-generated-media": true
},
"duration_seconds": {
"type": "number"
},
"id": {
"type": "string"
}
},
"required": [
"id",
"duration_seconds",
"audio_url"
],
"type": "object",
"unevaluatedProperties": false
},
"remaining_audio": {
"properties": {
"audio_url": {
"type": "string",
"x-runapi-generated-media": true
},
"duration_seconds": {
"type": "number"
},
"id": {
"type": "string"
}
},
"required": [
"id",
"duration_seconds",
"audio_url"
],
"type": "object",
"unevaluatedProperties": false
},
"stem_name": {
"type": "string"
}
},
"required": [
"stem_name",
"extracted_audio",
"remaining_audio"
],
"type": "object",
"unevaluatedProperties": false
},
"type": "array"
},
"percussion_url": {
"type": "string",
"x-runapi-generated-media": true
},
"piano_url": {
"type": "string",
"x-runapi-generated-media": true
},
"strings_url": {
"type": "string",
"x-runapi-generated-media": true
},
"synth_url": {
"type": "string",
"x-runapi-generated-media": true
},
"vocal_url": {
"type": "string",
"x-runapi-generated-media": true
},
"woodwinds_url": {
"type": "string",
"x-runapi-generated-media": true
}
},
"type": "object",
"unevaluatedProperties": false
},
"status": {
"enum": [
"processing"
],
"type": "string"
}
},
"required": [
"id",
"status",
"billing"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "processing"
}
ポーリング完了
GET /api/v1/suno/separate_audio_stems/:id
レスポンススキーマ
{
"properties": {
"billing": {
"properties": {
"refund": {
"oneOf": [
{
"properties": {
"refunded_at": {
"type": "string"
}
},
"required": [
"refunded_at"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"reservation": {
"oneOf": [
{
"properties": {
"amount_cents": {
"type": "integer"
}
},
"required": [
"amount_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"settlement": {
"oneOf": [
{
"properties": {
"amount_micro_cents": {
"type": "integer"
},
"charged_amount_cents": {
"type": "integer"
}
},
"required": [
"charged_amount_cents",
"amount_micro_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
}
},
"required": [
"reservation",
"settlement",
"refund"
],
"type": "object",
"unevaluatedProperties": false
},
"id": {
"type": "string"
},
"separated_audios": {
"properties": {
"backing_vocals_url": {
"type": "string",
"x-runapi-generated-media": true
},
"bass_url": {
"type": "string",
"x-runapi-generated-media": true
},
"brass_url": {
"type": "string",
"x-runapi-generated-media": true
},
"drums_url": {
"type": "string",
"x-runapi-generated-media": true
},
"fx_url": {
"type": "string",
"x-runapi-generated-media": true
},
"guitar_url": {
"type": "string",
"x-runapi-generated-media": true
},
"instrumental_url": {
"type": "string",
"x-runapi-generated-media": true
},
"keyboard_url": {
"type": "string",
"x-runapi-generated-media": true
},
"pairs": {
"items": {
"properties": {
"extracted_audio": {
"properties": {
"audio_url": {
"type": "string",
"x-runapi-generated-media": true
},
"duration_seconds": {
"type": "number"
},
"id": {
"type": "string"
}
},
"required": [
"id",
"duration_seconds",
"audio_url"
],
"type": "object",
"unevaluatedProperties": false
},
"remaining_audio": {
"properties": {
"audio_url": {
"type": "string",
"x-runapi-generated-media": true
},
"duration_seconds": {
"type": "number"
},
"id": {
"type": "string"
}
},
"required": [
"id",
"duration_seconds",
"audio_url"
],
"type": "object",
"unevaluatedProperties": false
},
"stem_name": {
"type": "string"
}
},
"required": [
"stem_name",
"extracted_audio",
"remaining_audio"
],
"type": "object",
"unevaluatedProperties": false
},
"type": "array"
},
"percussion_url": {
"type": "string",
"x-runapi-generated-media": true
},
"piano_url": {
"type": "string",
"x-runapi-generated-media": true
},
"strings_url": {
"type": "string",
"x-runapi-generated-media": true
},
"synth_url": {
"type": "string",
"x-runapi-generated-media": true
},
"vocal_url": {
"type": "string",
"x-runapi-generated-media": true
},
"woodwinds_url": {
"type": "string",
"x-runapi-generated-media": true
}
},
"type": "object",
"unevaluatedProperties": false
},
"status": {
"enum": [
"completed"
],
"type": "string"
}
},
"required": [
"id",
"status",
"separated_audios",
"billing"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"separated_audios": {
"instrumental_url": "https://file.runapi.ai/reference-instrumental.mp3",
"vocal_url": "https://file.runapi.ai/reference-vocals.mp3"
},
"status": "completed"
}
ポーリング失敗
GET /api/v1/suno/separate_audio_stems/:id
レスポンススキーマ
{
"properties": {
"billing": {
"properties": {
"refund": {
"oneOf": [
{
"properties": {
"refunded_at": {
"type": "string"
}
},
"required": [
"refunded_at"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"reservation": {
"oneOf": [
{
"properties": {
"amount_cents": {
"type": "integer"
}
},
"required": [
"amount_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
},
"settlement": {
"oneOf": [
{
"properties": {
"amount_micro_cents": {
"type": "integer"
},
"charged_amount_cents": {
"type": "integer"
}
},
"required": [
"charged_amount_cents",
"amount_micro_cents"
],
"type": "object",
"unevaluatedProperties": false
},
{
"enum": [
null
]
}
]
}
},
"required": [
"reservation",
"settlement",
"refund"
],
"type": "object",
"unevaluatedProperties": false
},
"error": {
"type": "string"
},
"id": {
"type": "string"
},
"status": {
"enum": [
"failed"
],
"type": "string"
}
},
"required": [
"id",
"status",
"error",
"billing"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"error": "Task processing failed.",
"id": "tsk_reference_demo",
"status": "failed"
}
顧客コールバック: 完了
POST callback_url
レスポンススキーマ
{
"properties": {
"id": {
"type": "string"
},
"separated_audios": {
"properties": {
"backing_vocals_url": {
"type": "string",
"x-runapi-generated-media": true
},
"bass_url": {
"type": "string",
"x-runapi-generated-media": true
},
"brass_url": {
"type": "string",
"x-runapi-generated-media": true
},
"drums_url": {
"type": "string",
"x-runapi-generated-media": true
},
"fx_url": {
"type": "string",
"x-runapi-generated-media": true
},
"guitar_url": {
"type": "string",
"x-runapi-generated-media": true
},
"instrumental_url": {
"type": "string",
"x-runapi-generated-media": true
},
"keyboard_url": {
"type": "string",
"x-runapi-generated-media": true
},
"pairs": {
"items": {
"properties": {
"extracted_audio": {
"properties": {
"audio_url": {
"type": "string",
"x-runapi-generated-media": true
},
"duration_seconds": {
"type": "number"
},
"id": {
"type": "string"
}
},
"required": [
"id",
"duration_seconds",
"audio_url"
],
"type": "object",
"unevaluatedProperties": false
},
"remaining_audio": {
"properties": {
"audio_url": {
"type": "string",
"x-runapi-generated-media": true
},
"duration_seconds": {
"type": "number"
},
"id": {
"type": "string"
}
},
"required": [
"id",
"duration_seconds",
"audio_url"
],
"type": "object",
"unevaluatedProperties": false
},
"stem_name": {
"type": "string"
}
},
"required": [
"stem_name",
"extracted_audio",
"remaining_audio"
],
"type": "object",
"unevaluatedProperties": false
},
"type": "array"
},
"percussion_url": {
"type": "string",
"x-runapi-generated-media": true
},
"piano_url": {
"type": "string",
"x-runapi-generated-media": true
},
"strings_url": {
"type": "string",
"x-runapi-generated-media": true
},
"synth_url": {
"type": "string",
"x-runapi-generated-media": true
},
"vocal_url": {
"type": "string",
"x-runapi-generated-media": true
},
"woodwinds_url": {
"type": "string",
"x-runapi-generated-media": true
}
},
"type": "object",
"unevaluatedProperties": false
},
"status": {
"enum": [
"completed"
],
"type": "string"
}
},
"required": [
"id",
"status",
"separated_audios"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"id": "tsk_reference_demo",
"separated_audios": {
"instrumental_url": "https://file.runapi.ai/reference-instrumental.mp3",
"vocal_url": "https://file.runapi.ai/reference-vocals.mp3"
},
"status": "completed"
}
顧客コールバック: 失敗
POST callback_url
レスポンススキーマ
{
"properties": {
"error": {
"oneOf": [
{
"type": "string"
},
{
"properties": {
"code": {
"type": "string"
},
"limit_cents": {
"type": "integer"
},
"message": {
"type": "string"
},
"reset_at": {
"format": "date-time",
"type": [
"string",
"null"
]
},
"used_cents": {
"type": "integer"
},
"window": {
"enum": [
"1h",
"1d",
"7d",
"daily",
"weekly",
"monthly",
"lifetime"
],
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"unevaluatedProperties": false
}
]
},
"id": {
"type": "string"
},
"status": {
"enum": [
"failed"
],
"type": "string"
}
},
"required": [
"id",
"status",
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": {
"code": "generation_failed",
"message": "Task processing failed."
},
"id": "tsk_reference_demo",
"status": "failed"
}
エラー
POST /api/v1/suno/separate_audio_stems
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Authentication required"
}
エラー
GET /api/v1/suno/separate_audio_stems/:id
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Authentication required"
}
エラー
POST /api/v1/suno/separate_audio_stems
レスポンススキーマ
{
"oneOf": [
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
},
{
"properties": {
"error": {
"description": "人間が読める形式のバリデーションサマリー。",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "公開リクエストフィールドをキーとするバリデーションメッセージ。各フィールドに対して人間が読める文字列の配列が含まれます。",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
]
}
レスポンス例
{
"error": "Validation failed",
"errors": {
"task_id": [
"is required"
]
}
}
エラー
POST /api/v1/suno/separate_audio_stems
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Insufficient balance"
}
エラー
POST /api/v1/suno/separate_audio_stems
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "API key credit limit exceeded"
}
エラー
POST /api/v1/suno/separate_audio_stems
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "The request uses features that are not supported for the selected model"
}
エラー
POST /api/v1/suno/separate_audio_stems
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Rate limit reached. Please retry later."
}
エラー
POST /api/v1/suno/separate_audio_stems
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Service under maintenance, please try again later"
}
エラー
POST /api/v1/suno/separate_audio_stems
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "The request timed out"
}
エラー
GET /api/v1/suno/separate_audio_stems/:id
レスポンススキーマ
{
"properties": {
"error": {
"description": "人が読めるエラーメッセージ。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
レスポンス例
{
"error": "Task with id 'tsk_reference_demo' not found"
}
生成されたコードサンプル
cURLを直接使用するか、お使いの言語向けのSDKをインストールしてください。各サンプルは、このリファレンスに示されたバリデーション済みリクエストを送信します。
インストール
pip install runapi-suno
import os
from runapi.suno import SunoClient
client = SunoClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.separate_audio_stems.create(
task_id="tsk_source_music",
audio_id="audio_reference",
type="separate_vocal"
)