Producer Tasks API 的对接和使用

Producer Tasks API 的对接和使用

Producer Tasks API 的主要功能是通过输入 Producer Audios Generation API 生成的任务ID来查询该任务的执行情况。

本文档将详细介绍 Producer Tasks API 的对接说明,帮助您轻松集成并充分利用该 API 的强大功能。通过 Producer Tasks API ,您可以轻松实现查询 Producer Audios Generation API 的任务执行情况。

申请流程

要使用 Producer Tasks API,需要先到 申请页面 Producer Audios Generation API申请相应的服务,然后复制 Producer Audios Generation API的任务ID,如图所示:


最后进入Tasks API页面 [Producer Tasks API ](https://platform.acedata.cloud/documents/622626b1-30a7-4799-a772-4946e1df3ac0?inviter_id=5467b179-223f-42ef-b91e-c6e5a133ce9c)申请相应的服务,进入页面之后,点击「Acquire」按钮,如图所示:

如果您尚未登录或注册,会自动跳转到登录页面邀请您来注册和登录,登录注册之后会自动返回当前页面。

首次申请时会有免费额度赠送,可以免费使用该 API。

请求示例

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
bash 复制代码
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 复制代码
{
  "_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,
  "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://storage.googleapis.com/corpusant-app-public/riffs/3bff6223-fe13-4bef-973e-2cbaef430d5d/image/1dd08826-478e-43a6-868f-aff5ababac2c.jpg",
        "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://storage.googleapis.com/corpusant-app-public/riffs/3bff6223-fe13-4bef-973e-2cbaef430d5d/audio/1dd08826-478e-43a6-868f-aff5ababac2c.m4a",
        "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"
      }
    ]
  },
  "duration": 40.06500005722046,
  "finished_at": 1767119785.589
}

返回结果一共有多个字段,request 字段就是发起任务时的 request body,同时response 字段是任务完成后返回的response body。字段介绍如下。

  • id,生成任务的 ID,用于唯一标识此次生成任务。
  • request,查询任务中的请求信息。
  • response,查询任务中的返回信息。

批量查询操作

这是是针对多个任务ID来进行查询任务详情,与上面不同的是需要将action选中为retrieve_batch

Request Body 包括:

  • ids:上传的任务ID数组。
  • action:对任务的操作方式。

设置如下图所示:

代码示例

可以发现,在页面右侧已经自动生成了各种语言的代码,如图所示:


部分代码示例如下:

CURL
bash 复制代码
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 将返回此次所有批量任务的具体详情信息。例如:

json 复制代码
{
  "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,
      "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://storage.googleapis.com/corpusant-app-public/riffs/3bff6223-fe13-4bef-973e-2cbaef430d5d/image/1dd08826-478e-43a6-868f-aff5ababac2c.jpg",
            "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://storage.googleapis.com/corpusant-app-public/riffs/3bff6223-fe13-4bef-973e-2cbaef430d5d/audio/1dd08826-478e-43a6-868f-aff5ababac2c.m4a",
            "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"
          }
        ]
      },
      "duration": 40.06500005722046,
      "finished_at": 1767119785.589
    },
    {
      "_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,
      "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://storage.googleapis.com/corpusant-app-public/riffs/3bff6223-fe13-4bef-973e-2cbaef430d5d/image/1dd08826-478e-43a6-868f-aff5ababac2c.jpg",
            "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://storage.googleapis.com/corpusant-app-public/riffs/3bff6223-fe13-4bef-973e-2cbaef430d5d/audio/1dd08826-478e-43a6-868f-aff5ababac2c.m4a",
            "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"
          }
        ]
      },
      "duration": 40.06500005722046,
      "finished_at": 1767119785.589
    }
  ],
  "count": 2
}

返回结果一共有多个字段,其中items是包含了批量任务的具体详情信息,每个任务的具体信息与上文的字段一样,字段信息如下。

  • items,批量任务的所有具体详情信息。它是一个数组,每个数组的元素和上文查询单个任务的返回结果格式是一样的。
  • count,此处批量查询任务的个数。

错误处理

在调用 API 时,如果遇到错误,API 会返回相应的错误代码和信息。例如:

  • 400 token_mismatched:Bad request, possibly due to missing or invalid parameters.
  • 400 api_not_implemented:Bad request, possibly due to missing or invalid parameters.
  • 401 invalid_token:Unauthorized, invalid or missing authorization token.
  • 429 too_many_requests:Too many requests, you have exceeded the rate limit.
  • 500 api_error:Internal server error, something went wrong on the server.

错误响应示例

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

结论

  • 500 api_error:Internal server error, something went wrong on the server.

错误响应示例

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

结论

通过本文档,您已经了解了如何使用 Producer Tasks API 进行查询单个或批量任务的所有具体详情信息。希望本文档能帮助您更好地对接和使用该 API。如有任何问题,请随时联系我们的技术支持团队。

相关推荐
小真zzz10 小时前
超越“快照”,深入“解剖”:搜极星专业版如何成为品牌AI心智的“高分辨率核磁共振”
大数据·人工智能·ai·seo·geo
不才小强10 小时前
YOLOv8目标检测实战详解
人工智能·yolo·目标检测
我是发哥哈10 小时前
横向评测:主流AI培训方案的关键维度对比
大数据·人工智能·学习·机器学习·chatgpt
IDZSY043010 小时前
实测机乎AI一个月:普通用户真实体验分享
人工智能
shdwak....sad10 小时前
星核协同体系 Skill 工程:原子型、工作流型与专属型架构设计
人工智能
FluxMelodySun10 小时前
机器学习(三十五) 概率图模型-精确推断与近似推断
人工智能·机器学习
AdMergeX10 小时前
南北同台,智启增长:AdMergeX 4月携全生态方案亮相深圳GTC与北京九日论道开发者沙龙
人工智能
GISer_Jing10 小时前
Todos
前端·人工智能·学习
MDIOT旗舰10 小时前
4G低功耗边缘计算网关:让智能抄表与远程运维从未如此简单
运维·人工智能·边缘计算·modbus·红外抄表·plc智能网关
好多渔鱼好多11 小时前
【AI编程工具】华为CodeArts Snap 实战进阶:从后端接口生成到鸿蒙 ArkTS 深度适配
ai编程·华为snap