تكامل واستخدام Producer Tasks API
تتمثل الوظيفة الرئيسية لـ Producer Tasks API في الاستعلام عن حالة تنفيذ مهمة عن طريق إدخال معرّف المهمة الذي أنشأته Producer Audios Generation API.
ستقدم هذه الوثيقة شرحًا تفصيليًا لتكامل Producer Tasks API، لمساعدتك على دمجها بسهولة والاستفادة الكاملة من إمكاناتها القوية. باستخدام Producer Tasks API، يمكنك بسهولة الاستعلام عن حالة تنفيذ مهام Producer Audios Generation API.
¶ إجراءات التقديم
لاستخدام Producer Audios Generation API، انتقل أولًا إلى لوحة تحكم 零壹AI للحصول على رمز API الخاص بك والاحتفاظ به لاستخدامه لاحقًا.

إذا لم تكن قد سجلت الدخول أو أنشأت حسابًا بعد، فستُحوَّل تلقائيًا إلى صفحة تسجيل الدخول لدعوتك إلى إنشاء حساب وتسجيل الدخول، وبعد الانتهاء ستعود تلقائيًا إلى الصفحة الحالية.
يمكن استخدام مفتاح API الخاص بالتطبيق العام للخدمات المفعّلة للحساب؛ أما مفتاح التطبيق المخصص فيُستخدم وفق نطاق خدمات ذلك التطبيق. يرجى التحقق من أذونات المفتاح ومدة صلاحيته وحدوده، والتأكد من أن رصيد التطبيق يكفي لدفع تكلفة هذا الطلب. تعتمد حصة التجربة المتاحة على ما يظهر في الحساب، وعندما يكون الرصيد غير كافٍ، يمكنك النقر على زر «إعادة الشحن».
📘 الوثائق الكاملة: Producer Audios Generation API →
¶ مثال على الطلب
يمكن استخدام Producer Tasks API للاستعلام عن نتائج Producer Audios Generation API. لمعرفة كيفية استخدام Producer Audios Generation API، يرجى الرجوع إلى وثيقة Producer Audios Generation API .
سنأخذ معرّف مهمة أعادته خدمة Producer Audios Generation API مثالًا لتوضيح كيفية استخدام واجهة API هذه. لنفترض أن لدينا معرّف المهمة: 1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad، وسنوضح فيما يلي كيفية القيام بذلك عن طريق تمرير معرّف مهمة.
¶ صورة توضيحية للمهمة

¶ إعداد ترويسات الطلب وجسمه
تتضمن ترويسات الطلب ما يلي:
accept: تحديد استلام نتائج الاستجابة بتنسيق JSON، وتُملأ هنا بالقيمةapplication/json.authorization: مفتاح استدعاء API، ويمكن اختياره مباشرة من القائمة المنسدلة بعد الحصول عليه.
يتضمن جسم الطلب ما يلي:
id: معرّف المهمة المُرسَل.action: طريقة التعامل مع المهمة.
تُضبط الإعدادات كما هو موضح في الصورة التالية:

¶ مثال على الكود
يمكن ملاحظة أن الأكواد بمختلف اللغات قد أُنشئت تلقائيًا على الجانب الأيمن من الصفحة، كما هو موضح في الصورة:

فيما يلي بعض أمثلة الكود:
¶ CURL
curl -X POST 'https://api.01ai.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 هو جسم الطلب عند بدء المهمة، بينما حقل response هو جسم الاستجابة المُرجع بعد اكتمال المهمة. وفيما يلي شرح الحقول.
id، معرّف مهمة التوليد، ويُستخدم لتحديد مهمة التوليد هذه بشكل فريد.request، معلومات الطلب في مهمة الاستعلام.response، معلومات الاستجابة في مهمة الاستعلام.created_at، وقت إنشاء المهمة، طابع زمني بصيغة Unix (بالثواني، عدد عشري).started_at، وقت بدء تنفيذ المهمة، طابع زمني بصيغة Unix (بالثواني، عدد عشري).finished_at، وقت اكتمال المهمة، طابع زمني بصيغة Unix (بالثواني، عدد عشري). لا يُعاد هذا الحقل عندما لا تكون المهمة مكتملة.elapsed، الوقت المستغرق لتنفيذ المهمة، بوحدة الثواني (عدد عشري، مع الاحتفاظ بثلاث منازل عشرية). لا يُعاد هذا الحقل عندما لا تكون المهمة مكتملة.
¶ عملية الاستعلام الجماعي
تُستخدم هذه العملية للاستعلام عن تفاصيل مهام متعددة باستخدام معرّفاتها، والاختلاف عن الطريقة أعلاه هو ضرورة اختيار retrieve_batch في action.
يشمل متن الطلب ما يلي:
ids:مصفوفة معرّفات المهام المرفوعة.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[المقطع الثاني]\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.01ai.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، إذا حدث خطأ، فستُرجع الواجهة رمز الخطأ والمعلومات المقابلة. على سبيل المثال:
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 هذه واستخدامها بصورة أفضل. إذا كانت لديك أي أسئلة، فلا تتردد في التواصل مع فريق الدعم الفني لدينا.

