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

# Producer Tasks API の連携と使用

> Producer Music Generation API guide - Ace Data Cloud

Producer Tasks API の主な機能は、Producer Audios Generation API によって生成されたタスクIDを入力して、そのタスクの実行状況を照会することです。

本ドキュメントでは、Producer Tasks API の連携手順を詳しく紹介し、この API の強力な機能を簡単に統合して十分に活用できるよう支援します。Producer Tasks API を通じて、Producer Audios Generation API のタスク実行状況を簡単に照会できます。

## 申請プロセス

Producer Audios Generation API を使用するには、まず [Ace Data Cloud コンソール](https://platform.acedata.cloud/console/applications) で API Token を取得し、予備として保管してください。

![](https://cdn.acedata.cloud/dvc3cg.jpg)

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

**1つの API Token でプラットフォームのすべてのサービスを呼び出すことができ、サービスごとに個別で申請する必要はありません。** 初回申請時には無料クレジットが付与され、無料で体験できます。クレジットが不足した場合は、[コンソール](https://platform.acedata.cloud/console/coin) で共通残高をチャージできます。

> 📘 完全なドキュメント：[Producer Audios Generation API →](https://platform.acedata.cloud/documents/producer-audios)

## リクエスト例

Producer Tasks API は、Producer Audios Generation API の結果を照会するために使用できます。Producer Audios Generation API の使用方法については、ドキュメント [Producer Audios Generation API ](https://platform.acedata.cloud/documents/producer-audios-integration) を参照してください。

Producer Audios Generation API サービスから返されたタスクIDを1つ例として、当該 API の使用方法を説明します。タスクID：1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad があると仮定し、次にタスクIDを1つ渡すことでどのようにするかを説明します。

### タスク例の図

<p>
  <img src="https://cdn.acedata.cloud/om6p6g.png" width="500" className="m-auto" />
</p>

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

**Request Headers** には以下が含まれます：

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

**Request Body** には以下が含まれます：

* `id`：アップロードしたタスクID。
* `action`：タスクへの操作方法。

設定は以下の図のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/bfe4ww.png" width="500" className="m-auto" />
</p>

### コード例

ページ右側にはすでに各種言語のコードが自動生成されていることがわかります。図のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/u4pb2f.png" width="500" className="m-auto" />
</p>

一部のコード例は以下のとおりです：

#### CURL

```bash theme={null}
curl -X POST 'https://api.acedata.cloud/producer/tasks' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
  "action": "retrieve"
}'
```

### レスポンス例

リクエストが成功すると、API はここでタスクの詳細情報を返します。例えば：

```json theme={null}
{
  "_id": "69541b81ff2676299ccc3b29",
  "id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
  "api_id": "01d96900-9f8c-41d7-814c-95c7a885ba61",
  "application_id": "920ba772-867a-48ae-8efa-9b9f94136199",
  "created_at": 1767119745.524,
  "started_at": 1767119745.584,
  "finished_at": 1767119785.589,
  "elapsed": 40.005,
  "credential_id": "eeae817d-d6ff-493e-8f88-6c62391da7c6",
  "request": {
    "action": "generate",
    "model": "FUZZ-2.0 Pro",
    "instrumental": false,
    "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
    "custom": true,
    "callback_url": "https://webhook.site/0d73431d-f833-4be4-9276-b6e1690d55c1"
  },
  "trace_id": "1da03537-4eb8-410d-b849-43f03085a3bb",
  "type": "audios",
  "user_id": "ad7afe47-cea9-4cda-980f-2ad8810e51cf",
  "response": {
    "task_id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
    "data": [
      {
        "id": "1dd08826-478e-43a6-868f-aff5ababac2c",
        "title": "Woke up with the sun in my eyes",
        "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
        "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
        "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
        "video_url": null,
        "image_id": "1dd08826-478e-43a6-868f-aff5ababac2c",
        "topic": null,
        "seed": "1490770667",
        "sound": "",
        "created_at": "2025-12-30T18:36:00.994141Z",
        "model": "FUZZ-2.0 Pro",
        "progress": "100%",
        "state": "succeeded",
        "duration": "135.2330158730159"
      }
    ]
  }
}
```

返される結果には複数のフィールドがあり、request フィールドはタスク開始時の request body であり、同時に response フィールドはタスク完了後に返される response body です。フィールドの紹介は以下のとおりです。

* `id`、生成タスクの ID。この生成タスクを一意に識別するために使用します。
* `request`、クエリタスク内のリクエスト情報。
* `response`、クエリタスク内のレスポンス情報。
* `created_at`、タスク作成時刻。Unix タイムスタンプ（秒、浮動小数点）。
* `started_at`、タスクの実行開始時刻。Unix タイムスタンプ（秒、浮動小数点）。
* `finished_at`、タスク完了時刻。Unix タイムスタンプ（秒、浮動小数点）。タスクが未完了の場合、このフィールドは返されません。
* `elapsed`、タスク実行時間。単位は秒（浮動小数点、小数点以下 3 桁を保持）。タスクが未完了の場合、このフィールドは返されません。

## 一括クエリ操作

これは複数のタスク ID を対象にタスク詳細をクエリするもので、上記と異なる点は action を retrieve\_batch に選択する必要があることです。

**Request Body** には以下が含まれます：

* `ids`：アップロードされたタスク ID の配列。
* `action`：タスクの操作方法。

設定は以下の図のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/jlkoma.png" width="500" className="m-auto" />
</p>

### コード例

ページ右側にはすでに各種言語のコードが自動生成されていることがわかります。以下の図のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/emw66n.png" width="500" className="m-auto" />
</p>

一部のコード例は以下のとおりです：

### レスポンス例

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

```json { theme={null}
  "items": [
    {
      "_id": "69541b81ff2676299ccc3b29",
      "id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
      "api_id": "01d96900-9f8c-41d7-814c-95c7a885ba61",
      "application_id": "920ba772-867a-48ae-8efa-9b9f94136199",
      "created_at": 1767119745.524,
      "started_at": 1767119745.584,
      "finished_at": 1767119785.589,
      "elapsed": 40.005,
      "credential_id": "eeae817d-d6ff-493e-8f88-6c62391da7c6",
      "request": {
        "action": "generate",
        "model": "FUZZ-2.0 Pro",
        "instrumental": false,
        "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
        "custom": true,
        "callback_url": "https://webhook.site/0d73431d-f833-4be4-9276-b6e1690d55c1"
      },
      "trace_id": "1da03537-4eb8-410d-b849-43f03085a3bb",
      "type": "audios",
      "user_id": "ad7afe47-cea9-4cda-980f-2ad8810e51cf",
      "response": {
        "task_id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
        "data": [
          {
            "id": "1dd08826-478e-43a6-868f-aff5ababac2c",
            "title": "Woke up with the sun in my eyes",
            "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
            "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
            "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
            "video_url": null,
            "image_id": "1dd08826-478e-43a6-868f-aff5ababac2c",
            "topic": null,
            "seed": "1490770667",
            "sound": "",
            "created_at": "2025-12-30T18:36:00.994141Z",
            "model": "FUZZ-2.0 Pro",
            "progress": "100%",
            "state": "succeeded",
            "duration": "135.2330158730159"
          }
        ]
      }
    }, {
      "_id": "69541b81ff2676299ccc3b29",
      "id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
      "api_id": "01d96900-9f8c-41d7-814c-95c7a885ba61",
      "application_id": "920ba772-867a-48ae-8efa-9b9f94136199",
      "created_at": 1767119745.524,
      "started_at": 1767119745.584,
      "finished_at": 1767119785.589,
      "elapsed": 40.005,
      "credential_id": "eeae817d-d6ff-493e-8f88-6c62391da7c6",
      "request": {
        "action": "generate",
        "model": "FUZZ-2.0 Pro",
        "instrumental": false,
        "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
        "custom": true,
        "callback_url": "https://webhook.site/0d73431d-f833-4be4-9276-b6e1690d55c1"
      },
      "trace_id": "1da03537-4eb8-410d-b849-43f03085a3bb",
      "type": "audios",
      "user_id": "ad7afe47-cea9-4cda-980f-2ad8810e51cf",
      "response":
{
        "task_id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
        "data": [
          {
            "id": "1dd08826-478e-43a6-868f-aff5ababac2c",
            "title": "目覚めると目に太陽が差し込んでいた",
            "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
            "lyric": "[ヴァース]\n目覚めると目に太陽が差し込んでいた\n頭上に雲はなく空にはただ青だけ\n足に靴を履いて走る準備はできている\n一歩一歩が装填された銃のように感じる\n[コーラス]\n幸せな日々がやって来る\n肌の下に喜びを感じさせて\nもう影も嘘もない\nただ私を高く舞い上がらせる真実だけ\n[ヴァース 2]\n街の通りを踊りながら進む\n心臓の鼓動にリズムが打ち鳴らされる\n見知らぬ人たちが微笑みそれが広がっていく\nこの世界は舞台で私たちは皆一つの歌\n[コーラス]\n幸せな日々がやって来る\n肌の下に喜びを感じさせて\nもう影も嘘もない\nただ私を高く舞い上がらせる真実だけ\n[ブリッジ]\n心配事をドアの外へ投げ出して\n海底まで沈ませよう\n私たちは生きていてそれで十分\n人生は雑然としているけれどそれは愛\n[コーラス]\n幸せな日々がやって来る\n肌の下に喜びを感じさせて\nもう影も嘘もない\nただ私を高く舞い上がらせる真実だけ",
            "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
            "video_url": null,
            "image_id": "1dd08826-478e-43a6-868f-aff5ababac2c",
            "topic": null,
            "seed": "1490770667",
            "sound": "",
            "created_at": "2025-12-30T18:36:00.994141Z",
            "model": "FUZZ-2.0 Pro",
            "progress": "100%",
            "state": "succeeded",
            "duration": "135.2330158730159"
          }
        ]
      }
    }
  ],
  "count": 2
}
```

返される結果には複数のフィールドがあり、その中のitemsにはバッチタスクの具体的な詳細情報が含まれています。各タスクの具体的な情報は上記のフィールドと同じであり、フィールド情報は以下のとおりです。

* `items`、バッチタスクのすべての具体的な詳細情報。これは配列であり、配列の各要素は上記の単一タスクを照会する際の返却結果形式と同じです。
* `count`、ここでバッチ照会するタスクの数。

#### CURL

```bash theme={null}
curl -X POST 'https://api.acedata.cloud/producer/tasks' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "ids": ["1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad","1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad"],
  "action": "retrieve_batch"
}'
```

## エラー処理

API を呼び出す際にエラーが発生した場合、API は対応するエラーコードと情報を返します。例えば：

* `400 token_mismatched`：Bad request、パラメータの欠落または無効が原因である可能性があります。
* `400 api_not_implemented`：Bad request、パラメータの欠落または無効が原因である可能性があります。
* `401 invalid_token`：Unauthorized、認証トークンが無効または欠落しています。
* `429 too_many_requests`：リクエストが多すぎます。レート制限を超えています。
* `500 api_error`：内部サーバーエラー、サーバー上で問題が発生しました。

### エラーレスポンス例

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

## 結論

本ドキュメントを通じて、Producer Tasks API を使用して単一またはバッチタスクのすべての具体的な詳細情報を照会する方法を理解しました。本ドキュメントが、この API の連携と使用により役立つことを願っています。ご不明な点がございましたら、いつでも弊社の技術サポートチームまでお問い合わせください。


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