> ## Documentation Index
> Fetch the complete documentation index at: https://docs.toapis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 音楽タスク状態の取得

> Suno 音楽タスクの状態と結果を照会

* 非同期音楽タスクの状態と結果を照会
* リアルタイム進捗トラッキング
* 完了時に音声・カバー・動画 URL を取得(CDN ミラー済み)
* 失敗タスクは自動返金

すべての音楽タスクは非同期実行です。送信後は本エンドポイントでポーリングしてください。

## Authorizations

<ParamField header="Authorization" type="string" required>
  Bearer Token。API Key:[API Key 管理ページ](https://toapis.com/console/token)
</ParamField>

## Path Parameters

<ParamField path="task_id" type="string" required>
  音楽生成 API が返したタスク ID(`tsk_aud_` プレフィックス)
</ParamField>

## Response

<ResponseField name="id" type="string">タスク ID</ResponseField>
<ResponseField name="status" type="string">`submitted` / `queued` / `in_progress` / `completed` / `failed`</ResponseField>
<ResponseField name="progress" type="integer">進捗 0-100</ResponseField>
<ResponseField name="cost" type="number">実際の上流コスト(USD)</ResponseField>
<ResponseField name="created" type="integer">作成時刻(Unix)</ResponseField>
<ResponseField name="completed" type="integer">完了時刻(Unix)</ResponseField>

<ResponseField name="result" type="object">
  タスク結果。構造は操作により異なります:

  <Expandable title="result 構造">
    <ResponseField name="music" type="array">`audio_url`、`image_url`、`title`、`tags`、`lyrics`、`duration` を含むトラック列</ResponseField>
    <ResponseField name="instruments" type="array">`midi`:トラック別 `name`/`program`/`is_drum`/`notes[]`</ResponseField>
    <ResponseField name="files" type="array">`download`:マルチフォーマットのファイル URL</ResponseField>
    <ResponseField name="videoUrl" type="string">`generateMp4`:動画 URL</ResponseField>
    <ResponseField name="avg_bpm" type="number">`bpm`:平均 BPM(ほか `max_bpm`/`min_bpm`)</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="error" type="object">失敗時のエラー(`code`/`message`)</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://toapis.com/v1/music/tasks/tsk_aud_01M3EXAMPLE \
    --header 'Authorization: Bearer <token>'
  ```

  ```python Python theme={null}
  import time
  import requests

  task_id = "tsk_aud_01M3EXAMPLE"
  while True:
      resp = requests.get(
          f"https://toapis.com/v1/music/tasks/{task_id}",
          headers={"Authorization": "Bearer <token>"}
      ).json()["data"]
      if resp["status"] in ("completed", "failed"):
          break
      time.sleep(5)
  print(resp["result"])
  ```
</RequestExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.