Suno V6 共通仕様とタスク照会
curl --request GET \
--url https://api.apimart.ai/v1/music/tasks/{task_id} \
--header 'Authorization: <authorization>'import requests
url = "https://api.apimart.ai/v1/music/tasks/{task_id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.apimart.ai/v1/music/tasks/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apimart.ai/v1/music/tasks/{task_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.apimart.ai/v1/music/tasks/{task_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.apimart.ai/v1/music/tasks/{task_id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apimart.ai/v1/music/tasks/{task_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"id": "task_01M24YMN4EV04M84R5QYM77R1E",
"status": "completed",
"progress": 100,
"created": 1789041600,
"cost": 0.12,
"credits_cost": 1.2,
"result": {
"music": [
{
"audio_id": "example-track-id",
"status": "complete",
"title": "follow the lights",
"lyrics": "[Verse]\nthe late wind blows over familiar streets",
"tags": "pop, acoustic",
"display_tags": "Pop, Acoustic",
"negative_tags": "harsh vocals",
"style_weight": 0.7,
"weirdness_constraint": 0,
"audio_weight": 0.4,
"duration": 119.8,
"audio_url": "https://example.com/result.mp3",
"image_url": "https://example.com/cover.jpg",
"image_large_url": "https://example.com/cover-large.jpg"
}
]
}
}
}
{
"code": 200,
"data": {
"id": "task_01M24YMN4EV04M84R5QYM77R1E",
"status": "failed",
"progress": 0,
"cost": 0,
"credits_cost": 0,
"error": {
"message": "task failure reason",
"type": "task_failed",
"code": "task_failed",
"param": ""
}
}
}
Suno
Suno V6 共通仕様とタスク照会
Suno V6 のバージョン選択、カスタムモデル、非同期タスクのライフサイクル、参照元トラック、結果構造
GET
/
v1
/
music
/
tasks
/
{task_id}
Suno V6 共通仕様とタスク照会
curl --request GET \
--url https://api.apimart.ai/v1/music/tasks/{task_id} \
--header 'Authorization: <authorization>'import requests
url = "https://api.apimart.ai/v1/music/tasks/{task_id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.apimart.ai/v1/music/tasks/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apimart.ai/v1/music/tasks/{task_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.apimart.ai/v1/music/tasks/{task_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.apimart.ai/v1/music/tasks/{task_id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apimart.ai/v1/music/tasks/{task_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"id": "task_01M24YMN4EV04M84R5QYM77R1E",
"status": "completed",
"progress": 100,
"created": 1789041600,
"cost": 0.12,
"credits_cost": 1.2,
"result": {
"music": [
{
"audio_id": "example-track-id",
"status": "complete",
"title": "follow the lights",
"lyrics": "[Verse]\nthe late wind blows over familiar streets",
"tags": "pop, acoustic",
"display_tags": "Pop, Acoustic",
"negative_tags": "harsh vocals",
"style_weight": 0.7,
"weirdness_constraint": 0,
"audio_weight": 0.4,
"duration": 119.8,
"audio_url": "https://example.com/result.mp3",
"image_url": "https://example.com/cover.jpg",
"image_large_url": "https://example.com/cover-large.jpg"
}
]
}
}
}
{
"code": 200,
"data": {
"id": "task_01M24YMN4EV04M84R5QYM77R1E",
"status": "failed",
"progress": 0,
"cost": 0,
"credits_cost": 0,
"error": {
"message": "task failure reason",
"type": "task_failed",
"code": "task_failed",
"param": ""
}
}
}
Suno の生成、編集、ツール API はすべて非同期タスクです。操作を送信して
task_id を取得し、このページの API で結果を照会します。認証
string
必須
Bearer Token 認証:
Authorization: Bearer <YOUR_API_KEY>。V6 のバージョンとモデルの選択
公開モデルは次のバージョンに対応します。v6v6-wildv6-mini
version またはモデル作成タスクが返した custom_model_id のどちらかが必要です。バージョン対応の編集操作では、version を省略すると v6 が使用されます。公開 version と custom_model_id は同時に送信できません。
custom: true はカスタム歌詞モードを選択し、custom_model_id はトレーニング済みカスタムモデルを選択します。両者は別の概念です。カスタム歌詞モードを使っても、自動的にカスタムモデル料金には切り替わりません。V6 共通生成オプション
次のフィールドは、個別のエンドポイントに記載されている場合にのみ送信してください。| フィールド | 説明 |
|---|---|
variety | スタイルの変化:off / normal / high / extra / max |
max_mode | Max モード。既定値 false。対応する操作では通常価格の 2 倍で課金 |
audio_format | mp3 / m4a / wav |
duration / duration_s | 目標生成時間。10~360 秒の整数。指定された生成操作でのみ使用可能 |
max_mode: false を送信しないでください。variety と Max モードは独立しているため、variety: "max" を選んでも Max 課金は有効になりません。
テキストと重みの制限
| 内容 | フィールド | 制限 |
|---|---|---|
| インスピレーションの説明 | prompt(メイン生成)/ gpt_description(操作 API) | 最大 3,000 文字 |
| 歌詞 | prompt(カスタムモード) | 最大 5,000 文字 |
| スタイル | style(メイン生成)/ tags(操作 API) | 最大 1,000 文字 |
| タイトル | title | 最大 80 文字 |
| 重み | style_weight / weirdness / audio_weight | 0~1。数値の 0 も有効 |
weirdness を使用し、weirdness_constraint は互換用の別名です。メイン生成では引き続き weirdness_constraint を使用します。文字数は Unicode 文字単位で計算されます。
参照元トラック
既存の作品を基にする操作:task_id:出力音声トラックの API Mart タスク ID。audio_index:参照元タスクの照会レスポンスにあるdata.result.music[]内の元の位置です。1 始まりで、既定値は1です。
新しいリクエストでは参照元トラックを
task_id + audio_index で指定します。audio_id、music_id、audio_url では代用できません。参照元タスクを解決できない場合やインデックスが範囲外の場合は 400 が返されます。送信レスポンス
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01M24YMN4EV04M84R5QYM77R1E"
}
]
}
data[0].task_id からタスク ID を取得します。submitted はタスクが受理されたことだけを示し、最終的な音声などがすでに生成済みという意味ではありません。
タスクを照会
GET /v1/music/tasks/{task_id}
?language=zh を追加すると、対応する失敗メッセージの翻訳を取得できます。このパラメーターは曲や歌詞の言語を変更しません。
string
必須
送信 API が返すタスク ID。
data.status が completed または failed になるまで 5~10 秒ごとに照会することを推奨します。ページ更新後も同じタスク ID を使用できます。ネットワークタイムアウトを理由に有料 POST リクエストを自動再送しないでください。
照会レスポンス
integer
レスポンスステータスコード。
object
タスク情報。
表示 プロパティ
表示 プロパティ
string
プラットフォームのタスク ID。
string
pending / processing / completed / failed / unknown。number
タスクの進捗。通常は 0~100 です。完了判定には
status を使用してください。number
作成日時(Unix 秒)。
number
推定処理時間(秒)。参考値であり、カウントダウンを保証するものではありません。
number
金額(USD)。
number
タスクが消費したポイント数。API の戻り値をそのまま表示してください。
object
完了後の結果。構造は操作によって異なります。
object
失敗メッセージ。一般的なフィールドは
message / type / code / param です。{
"code": 200,
"data": {
"id": "task_01M24YMN4EV04M84R5QYM77R1E",
"status": "completed",
"progress": 100,
"created": 1789041600,
"cost": 0.12,
"credits_cost": 1.2,
"result": {
"music": [
{
"audio_id": "example-track-id",
"status": "complete",
"title": "follow the lights",
"lyrics": "[Verse]\nthe late wind blows over familiar streets",
"tags": "pop, acoustic",
"display_tags": "Pop, Acoustic",
"negative_tags": "harsh vocals",
"style_weight": 0.7,
"weirdness_constraint": 0,
"audio_weight": 0.4,
"duration": 119.8,
"audio_url": "https://example.com/result.mp3",
"image_url": "https://example.com/cover.jpg",
"image_large_url": "https://example.com/cover-large.jpg"
}
]
}
}
}
{
"code": 200,
"data": {
"id": "task_01M24YMN4EV04M84R5QYM77R1E",
"status": "failed",
"progress": 0,
"cost": 0,
"credits_cost": 0,
"error": {
"message": "task failure reason",
"type": "task_failed",
"code": "task_failed",
"param": ""
}
}
}
結果の処理
- 音楽関連の結果は通常
data.result.music[]にありますが、ダウンロード、歌詞、MIDI、Persona、カスタムモデルなどの操作では結果構造が異なります。 durationは実際の長さで、小数を含む場合があります。入力した目標時間と完成品の長さが完全に一致するとは限りません。- 重みの戻り値
0は有効です。JavaScript の falsy 判定で非表示にしないでください。 audio_urlの末尾が.mp3であるとは限りません。API が返す実際の URL を使用して再生またはダウンロードしてください。status="unknown"の場合はタスク ID を保持して手動更新を許可し、新しいタスクを自動作成しないでください。
AbortController はブラウザーリクエストとポーリングを停止できますが、サーバー側のタスクはキャンセルしません。現在、送信済み Suno タスクをキャンセルする API はありません。