Producer Tasks API 的串接和使用
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 控制台 取得您的 API Token,留作備用。

如果您尚未登入或註冊,會自動跳轉到登入頁面邀請您註冊和登入,完成後會自動返回目前頁面。
通用應用程式的 API Key 可用於帳號已開放的服務;專用應用程式的 Key 按該應用程式的服務範圍使用。請檢查 Key 的權限、有效期限和額度限制,並確認應用程式餘額足以支付本次請求。可用試用額度以帳號顯示為準,餘額不足時點擊「儲值」按鈕即可。
¶ 請求範例
Producer Tasks API 可以用於查詢 Producer Audios Generation API 的結果。關於如何使用 Producer Audios Generation API,請參考文件 Producer Audios Generation API 。
我們以 Producer Audios Generation API 服務回傳的一個任務 ID 為例,示範如何使用該 API。假設我們有一個任務 ID:1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad,接下來示範如何透過傳入一個任務 ID 來。
¶ 任務範例圖

¶ 設定請求標頭和請求本文
Request Headers 包括:
accept:指定接收 JSON 格式的回應結果,這裡填寫為application/json。authorization:呼叫 API 的金鑰,申請之後可以直接下拉選擇。
Request Body 包括:
id:上傳的任務 ID。action:對任務的操作方式。
設定如下圖所示:

¶ 程式碼範例
可以發現,在頁面右側已經自動產生了各種語言的程式碼,如圖所示:

部分程式碼範例如下:
¶ CURL
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 將回傳此處任務的詳細資訊。例如:
{
"_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:對任務的操作方式。
設定如下圖所示:

¶ 程式碼範例
可以發現,在頁面右側已經自動產生了各種語言的程式碼,如圖所示:

部分程式碼範例如下:
¶ 回應範例
請求成功後,API 將回傳此次所有批次任務的具體詳情資訊。例如:
"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
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:錯誤的請求,可能是因為缺少參數或參數無效。400 api_not_implemented:錯誤的請求,可能是因為缺少參數或參數無效。401 invalid_token:未經授權,授權權杖無效或缺失。429 too_many_requests:請求過多,您已超過速率限制。500 api_error:伺服器內部錯誤,伺服器發生問題。
¶ 錯誤回應範例
{
"success": false,
"error": {
"code": "api_error",
"message": "fetch failed"
},
"trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}
¶ 結論
透過本文檔,您已經了解如何使用 Producer Tasks API 查詢單一或批次任務的所有具體詳細資訊。希望本文檔能幫助您更好地對接和使用該 API。如有任何問題,請隨時聯絡我們的技術支援團隊。
