Suno Tasks API の連携と使用方法

Suno Tasks API では、タスク ID を使って、楽曲生成や音声エクスポートなどの Suno リクエストの実行状況を照会できます。

申請手順

orchats コンソールにアクセスし、タスク照会権限のある API Key を取得します。例では環境変数 API_KEY を使用します。

タスクを送信したときのアプリケーション ID で照会してください。照会では Credits は消費されません。

まだログインまたは登録していない場合は、登録とログインを促すログインページに自動的にリダイレクトされ、完了後は現在のページに自動的に戻ります。

汎用アプリケーションの API Key は、アカウントで利用可能になっているサービスに使用できます。専用アプリケーションの Key は、そのアプリケーションのサービス範囲に応じて使用します。Key の権限、有効期限、上限を確認し、アプリケーションの残高が今回のリクエストの支払いに十分であることを確認してください。利用可能な試用クレジットはアカウントに表示される内容に準じます。残高が不足している場合は「チャージ」ボタンをクリックしてください。

📘 完全なドキュメント:Suno Audios Generation API →

リクエスト例

Suno Audios Generation API の非同期楽曲タスクを例にします。送信後、返された task_id を保存します。

以下は実際にテストした楽曲タスクで、タスク ID は c409f30d-4b2f-4ad9-8ae7-f394e367713d です。コード内ではご自身のタスク ID に置き換えてください。

タスクの例

上記のタスク ID を使って retrieve 照会を送信します。完了時刻は finished_at に表示されます。今回のタスクの response.success は true で、response.data には Room for One More Chair と Always Room for More の 2 曲の候補が含まれています。

リクエストヘッダーとリクエストボディの設定

Request Headers には以下が含まれます。

  • accept:受信するレスポンス結果の形式を JSON に指定します。ここでは application/json を入力します。
  • authorization:API を呼び出すためのキーです。申請後、ドロップダウンから直接選択できます。

Request Body には以下が含まれます。

  • id:アップロードしたタスクの ID。
  • action:タスクに対する操作方法。

リクエストボディは以下のとおりです。

{
  "action": "retrieve",
  "id": "c409f30d-4b2f-4ad9-8ae7-f394e367713d"
}

コード例

デバッグページの右側で対応する呼び出しコードを生成できます。以下に cURL と Python の例をそれぞれ示します。

CURL

curl -sS -X POST 'https://api.orchats.repoingest.com/suno/tasks' \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
  "action": "retrieve",
  "id": "c409f30d-4b2f-4ad9-8ae7-f394e367713d"
}'

Python

import os

import requests

url = "https://api.orchats.repoingest.com/suno/tasks"
headers = {
    "accept": "application/json",
    "authorization": f"Bearer {os.environ['API_KEY']}",
    "content-type": "application/json",
}
payload = {
    "action": "retrieve",
    "id": "c409f30d-4b2f-4ad9-8ae7-f394e367713d",
}

response = requests.post(url, json=payload, headers=headers, timeout=180)
print(response.text)

レスポンス例

リクエストが成功すると、API はこの楽曲タスクの詳細情報を返します。例えば、以下のようになります。

{
  "id": "c409f30d-4b2f-4ad9-8ae7-f394e367713d",
  "type": "audios",
  "created_at": 1796115741.863,
  "started_at": 1796115741.863,
  "finished_at": 1796115800.404,
  "elapsed": 58.541,
  "request": {
    "action": "generate",
    "model": "chirp-v6",
    "prompt": "A song for Christmas"
  },
  "trace_id": "f9ff7920-2b74-4c69-867b-183cd41166fa",
  "response": {
    "success": true,
    "task_id": "c409f30d-4b2f-4ad9-8ae7-f394e367713d",
    "trace_id": "f9ff7920-2b74-4c69-867b-183cd41166fa",
    "data": [
      {
        "id": "15b56d7a-1ad1-4dc6-bc74-79b102caceeb",
        "title": "Room for One More Chair",
        "lyric": "[Verse 1]\nThe kettle sings, the window steams\nA paper chain hangs slightly crooked\nYou set the old tin on the shelf\nAnd laugh at how the years have kept it",
        "audio_url": "https://cdn.acedata2.cloud/suno/15b56d7a-1ad1-4dc6-bc74-79b102caceeb.mp3",
        "created_at": "2026-12-01T09:02:22.466Z",
        "model": "chirp-v6",
        "state": "succeeded",
        "prompt": "A song for Christmas",
        "style": "Cinematic Christmas pop with film-score scale, a steady four-on-the-floor pulse, driving syncopated percussion, and a repeating cello ostinato. Begin with intimate piano and close, warm lead vocals; build through layered strings, brass swells, and wordless choir accents into a wide, uplifting final chorus. Polished, spacious mix with clear vocal focus and dynamic section lifts.",
        "duration": 231.96
      },
      {
        "id": "555bf85a-907c-4573-b6f3-e816c04aabb9",
        "title": "Always Room for More",
        "lyric": "[Intro]\n[Wordless vocals]\nOh—ah, oh—ah\n[Verse 1]\nSnow gathers softly on the windowpane",
        "audio_url": "https://cdn.acedata2.cloud/suno/555bf85a-907c-4573-b6f3-e816c04aabb9.mp3",
        "created_at": "2026-12-01T09:02:22.466Z",
        "model": "chirp-v6",
        "state": "succeeded",
        "prompt": "A song for Christmas",
        "style": "Cinematic Christmas pop with marathon-film scale, syncopated rhythmic drive, cello ostinato, four-on-the-floor pulse, and wordless vocal drops. Begin with a restrained cello figure and distant wordless voices; build into a broad, uplifting chorus with layered strings, punchy percussion, and a clear lead vocal. Use a brief countdown-style dropout before the final chorus, then finish with a full, resolved orchestral-pop ending. Polished, spacious mix with strong low-end and crisp rhythmic detail.",
        "duration": 231.2
      }
    ],
    "cost": {
      "amount": 0.504,
      "currency": "credit",
      "list_amount": 0.56
    }
  }
}

返される結果には複数のフィールドがあり、request フィールドはタスクを開始したときの request body、response フィールドはタスクの完了後に返される response body です。各フィールドの説明は以下のとおりです。

  • id:この楽曲タスクを生成するための ID で、今回の楽曲生成タスクを一意に識別します。
  • request:楽曲タスクを照会する際のリクエスト情報。
  • response:タスクの完了時に返される結果。新しく生成された楽曲の response.data[].image_url は元のカバー画像の URL で、高解像度のカバー画像が提供されている場合は image_large_url から取得できます。過去のタスクでは、その時点で保存されたリンクが返されます。
  • created_at:タスクの作成時刻。Unix タイムスタンプ(秒、浮動小数点数)。
  • started_at:タスクの実行開始時刻。Unix タイムスタンプ(秒、浮動小数点数)。
  • finished_at:タスクの完了時刻。Unix タイムスタンプ(秒)。タスクが未完了の場合は存在しないか、空になります。
  • elapsed:タスクの実行にかかった時間。単位は秒です。タスク完了後に提供されます。 HTTP 200 はクエリの成功を示します。まず finished_at に値が入るのを待ち、その後 response.success を読み取ります。タスクが成功したら response.data を取得し、失敗した場合は response.error を確認します。

一括クエリ操作

複数のタスクを一括でクエリする場合は、action を retrieve_batch に設定します。

リクエストボディ には以下が含まれます。

  • ids:アップロードされたタスクIDの配列。
  • action:タスクに対する操作方法。

リクエストボディは以下のとおりです。

{
  "action": "retrieve_batch",
  "ids": [
    "c409f30d-4b2f-4ad9-8ae7-f394e367713d",
    "1a01d321-6780-4d8e-8612-02a0fad33102"
  ]
}

コード例

cURL または Python を使用して、同じリクエストボディを送信できます。

レスポンス例

リクエストが成功すると、API は今回の一括楽曲タスクのすべての詳細情報を返します。例:

{
  "items": [
    {
      "id": "c409f30d-4b2f-4ad9-8ae7-f394e367713d",
      "type": "audios",
      "created_at": 1796115741.863,
      "started_at": 1796115741.863,
      "finished_at": 1796115800.404,
      "elapsed": 58.541,
      "request": {
        "action": "generate",
        "model": "chirp-v6",
        "prompt": "A song for Christmas"
      },
      "trace_id": "f9ff7920-2b74-4c69-867b-183cd41166fa",
      "response": {
        "success": true,
        "task_id": "c409f30d-4b2f-4ad9-8ae7-f394e367713d",
        "trace_id": "f9ff7920-2b74-4c69-867b-183cd41166fa",
        "data": [
          {
            "id": "15b56d7a-1ad1-4dc6-bc74-79b102caceeb",
            "title": "Room for One More Chair",
            "lyric": "[Verse 1]\nThe kettle sings, the window steams\nA paper chain hangs slightly crooked\nYou set the old tin on the shelf\nAnd laugh at how the years have kept it",
            "audio_url": "https://cdn.acedata2.cloud/suno/15b56d7a-1ad1-4dc6-bc74-79b102caceeb.mp3",
            "created_at": "2026-12-01T09:02:22.466Z",
            "model": "chirp-v6",
            "state": "succeeded",
            "prompt": "A song for Christmas",
            "style": "Cinematic Christmas pop with film-score scale, a steady four-on-the-floor pulse, driving syncopated percussion, and a repeating cello ostinato. Begin with intimate piano and close, warm lead vocals; build through layered strings, brass swells, and wordless choir accents into a wide, uplifting final chorus. Polished, spacious mix with clear vocal focus and dynamic section lifts.",
            "duration": 231.96
          },
          {
            "id": "555bf85a-907c-4573-b6f3-e816c04aabb9",
            "title": "Always Room for More",
            "lyric": "[Intro]\n[Wordless vocals]\nOh—ah, oh—ah\n[Verse 1]\nSnow gathers softly on the windowpane",
            "audio_url": "https://cdn.acedata2.cloud/suno/555bf85a-907c-4573-b6f3-e816c04aabb9.mp3",
            "created_at": "2026-12-01T09:02:22.466Z",
            "model": "chirp-v6",
            "state": "succeeded",
            "prompt": "A song for Christmas",
            "style": "Cinematic Christmas pop with marathon-film scale, syncopated rhythmic drive, cello ostinato, four-on-the-floor pulse, and wordless vocal drops. Begin with a restrained cello figure and distant wordless voices; build into a broad, uplifting chorus with layered strings, punchy percussion, and a clear lead vocal. Use a brief countdown-style dropout before the final chorus, then finish with a full, resolved orchestral-pop ending. Polished, spacious mix with strong low-end and crisp rhythmic detail.",
            "duration": 231.2
          }
        ],
        "cost": {
          "amount": 0.504,
          "currency": "credit",
          "list_amount": 0.56
        }
      }
    },
    {
      "id": "1a01d321-6780-4d8e-8612-02a0fad33102",
      "type": "audios",
      "created_at": 1796115741.902,
      "started_at": 1796115741.902,
      "finished_at": 1796115778.27,
      "elapsed": 36.368,
      "request": {
        "action": "generate",
        "model": "chirp-v6",
        "title": "Window Lights",
        "style": "Soft acoustic folk, fingerpicked guitar and brushed drums",
        "lyric": "[Verse]\nWindow lights across the bay\nGuide the boats that drift away\n[Chorus]\nBring the morning home to me\nFold the stars into the sea",
        "custom": true,
        "duration": 90,
        "async": true
      },
      "trace_id": "ffddaa23-a3dd-44de-aa4e-58a6e3f1ca2c",
      "response": {
        "success": true,
        "task_id": "1a01d321-6780-4d8e-8612-02a0fad33102",
        "trace_id": "ffddaa23-a3dd-44de-aa4e-58a6e3f1ca2c",
        "data": [
          {
            "id": "8603c0f3-a396-455c-b945-fb48e65bf014",
            "title": "Window Lights",
            "lyric": "[Verse]\nWindow lights across the bay\nGuide the boats that drift away\n[Chorus]\nBring the morning home to me\nFold the stars into the sea",
            "audio_url": "https://cdn.acedata2.cloud/suno/8603c0f3-a396-455c-b945-fb48e65bf014.mp3",
            "created_at": "2026-12-01T09:02:22.389Z",
            "model": "chirp-v6",
            "state": "succeeded",
            "style": "Soft acoustic folk, fingerpicked guitar and brushed drums",
            "duration": 89.48
          },
          {
            "id": "50487a72-bc9c-4511-93d7-e2949dfb00c0",
            "title": "Window Lights",
            "lyric": "[Verse]\nWindow lights across the bay\nGuide the boats that drift away\n[Chorus]\nBring the morning home to me\nFold the stars into the sea",
            "audio_url": "https://cdn.acedata2.cloud/suno/50487a72-bc9c-4511-93d7-e2949dfb00c0.mp3",
            "created_at": "2026-12-01T09:02:22.389Z",
            "model": "chirp-v6",
            "state": "succeeded",
            "style": "Soft acoustic folk, fingerpicked guitar and brushed drums",
            "duration": 89.56
          }
        ],
        "cost": {
          "amount": 0.504,
          "currency": "credit",
          "list_amount": 0.56
        }
      }
    }
  ],
  "count": 2
}

返される結果には複数のフィールドがあり、そのうち items には一括楽曲タスクの詳細情報が含まれます。各楽曲タスクの詳細情報は上記のフィールドと同じで、フィールドの情報は以下のとおりです。

  • items、一括楽曲タスクのすべての詳細情報。これは配列であり、配列の各要素は上記の単一タスクのクエリ結果と同じ形式です。
  • count、今回一括クエリした楽曲タスクの数。

CURL

curl -sS -X POST 'https://api.orchats.repoingest.com/suno/tasks' \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
  "action": "retrieve_batch",
  "ids": [
    "c409f30d-4b2f-4ad9-8ae7-f394e367713d",
    "1a01d321-6780-4d8e-8612-02a0fad33102"
  ]
}'

Python

import os

import requests

url = "https://api.orchats.repoingest.com/suno/tasks"
headers = {
    "accept": "application/json",
    "authorization": f"Bearer {os.environ['API_KEY']}",
    "content-type": "application/json",
}
payload = {
    "action": "retrieve_batch",
    "ids": ["c409f30d-4b2f-4ad9-8ae7-f394e367713d", "1a01d321-6780-4d8e-8612-02a0fad33102"],
}

response = requests.post(url, json=payload, headers=headers, timeout=180)
print(response.text)

エラー処理

API の呼び出し時にエラーが発生した場合、API は対応するエラーコードとメッセージを返します。例えば:

  • 400 token_mismatched:タスク ID とアプリケーションの所属を確認してください。
  • 400 api_not_implemented:照会操作とパラメータを確認してください。
  • 401 invalid_token:API Key が有効かどうかを確認してください。
  • 429 too_many_requests:Retry-After(ある場合)またはバックオフ戦略に従ってポーリングの間隔を長くしてください。
  • 500 api_error:trace_id を保存し、ネットワークの復旧後に同じタスクを照会してください。

エラーレスポンスの例

{
  "success": false,
  "error": {
    "code": "api_error",
    "message": "fetch failed"
  },
  "trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}

タスク自体の失敗

照会では HTTP 200 が返される場合があります。以下は、リメイクタスクが失敗した後の照会結果です。

{
  "id": "add2ba31-609e-48ca-9933-5711a88067fe",
  "finished_at": 1796063763.654,
  "response": {
    "success": false,
    "task_id": "add2ba31-609e-48ca-9933-5711a88067fe",
    "trace_id": "47579d6e-185f-462e-83d2-6c827675e58d",
    "error": {
      "code": "timeout",
      "message": "timeout while waiting for audio generation"
    }
  }
}

タスクの失敗の詳細は response.error にあります。再試行する前に、オプションの retryable フィールドを確認してください。 楽曲生成の再試行ルール このドキュメントを通じて、Suno Tasks API を使用して単一または複数の楽曲タスクを照会する方法の詳細をすべてご理解いただけました。このドキュメントが、API との連携と利用にお役立ていただければ幸いです。ご不明な点がございましたら、いつでも技術サポートチームにお問い合わせください。