شرح التكامل مع واجهة Producer Audios Generation API
ستقدم هذه المقالة شرحًا للتكامل مع واجهة Producer Audios Generation API، التي تتيح إنشاء موسيقى Producer الرسمية عن طريق إدخال معلمات مخصصة.
¶ عملية التقديم
لاستخدام واجهة Producer Audios Generation API، انتقل أولًا إلى لوحة تحكم AI 聚合 للحصول على رمز API Token الخاص بك، والاحتفاظ به لاستخدامه لاحقًا.

إذا لم تكن قد سجلت الدخول أو أنشأت حسابًا بعد، فستُحوَّل تلقائيًا إلى صفحة تسجيل الدخول لدعوتك إلى إنشاء حساب وتسجيل الدخول، وبعد الانتهاء ستعود تلقائيًا إلى الصفحة الحالية.
يمكن استخدام مفتاح API الخاص بالتطبيق العام للخدمات المفعّلة للحساب؛ أما مفتاح التطبيق المخصص فيُستخدم وفقًا لنطاق خدمات ذلك التطبيق. يرجى التحقق من صلاحيات المفتاح ومدة صلاحيته وحدوده، والتأكد من أن رصيد التطبيق يكفي لدفع تكلفة هذا الطلب. تعتمد الأرصدة التجريبية المتاحة على ما يظهر في الحساب، وعندما يكون الرصيد غير كافٍ، يمكن النقر على زر «إعادة الشحن».
📘 الوثائق الكاملة: Producer Audios Generation API →
¶ اختيار المعلمات المطلوبة حسب العملية
عندما تكون action=generate وcustom=false (القيمة الافتراضية)، قدّم prompt؛ وعندما تكون custom=true
وinstrumental=false، قدّم lyric. لإنشاء موسيقى آلية مخصصة، يمكن تعيين
custom=true, instrumental=true، دون الحاجة إلى اختلاق كلمات أو إضافة مطالبات إضافية.
تتطلب action=extend توفير audio_id وcontinue_at بقيمة أكبر من 0، كما يتطلب وضع الموسيقى غير الآلية
توفير lyric. تتطلب عمليات إعادة الغناء وإنشاء النسخ المتنوعة واستبدال المقاطع وتبديل الأجزاء الصوتية وفصل المسارات الصوتية جميعها توفير audio_id للمصدر؛
ولا ينبغي اشتراط الكلمات والمطالبات دون قيد لجميع العمليات.
في MCP، تختار producer_extend_music وproducer_replace_section وضع الكلمات المخصصة عند تقديم lyric؛
ويمكن لمتابعة الموسيقى الآلية تمرير instrumental=true وحذف الكلمات.
¶ الاستخدام الأساسي
أيًا كانت الأغنية التي تريدها، يمكنك إدخال أي نص، فعلى سبيل المثال، إذا أردت إنشاء أغنية عن عيد الميلاد، يمكنك إدخال a song for Christmas، كما هو موضح في الصورة:

يمكن ملاحظة أننا ضبطنا هنا ترويسات الطلب، وتشمل:
accept:تنسيق نتيجة الاستجابة المطلوب استلامها، وهنا أُدخلت القيمةapplication/json، أي تنسيق JSON.authorization:مفتاح استدعاء API، ويمكن اختياره مباشرة من القائمة المنسدلة بعد الحصول عليه.
بالإضافة إلى ذلك، تشمل معلمات جسم الطلب:
action:الإجراء الخاص بمهمة إنشاء الموسيقى هذه، ويكونgenerateلإنشاء أغنية.model:النموذج المستخدم لإنشاء الأغنية، وتشمل النماذج المتاحة حاليًا بشكل رئيسي: FUZZ-2.0 Pro، FUZZ-2.0، FUZZ-2.0 Raw، FUZZ-1.1 Pro، FUZZ-1.0 Pro، FUZZ-1.0، FUZZ-1.1، FUZZ-0.8.lyric:محتوى كلمات الأغنية.custom:ما إذا كان سيتم إنشاء الأغنية بطريقة مخصصة.prompt:المطالبة في وضع الإلهام.title:معلومات عنوان الأغنية.audio_id:معرّف الأغنية المرجعية، ويُستخدم لعمليات المتابعة أو إعادة الغناء وغيرها.continue_at:متابعة الأغنية بدءًا من الثانية المحددة.replace_section_start/replace_section_end:وقتا بداية المقطع المراد استبداله ونهايته، بالثواني.lyrics_strength:قوة الكلمات، وتشير إلى مدى تأثير الكلمات في إنشاء الصوت، ويمكن اختيار قيمة بين 0 و1، والقيمة الافتراضية هي 0.5.sound_strength:قوة المطالبة الصوتية، ويمكن اختيار قيمة بين 0.2 و1، والقيمة الافتراضية هي 0.5.cover_strength:قوة إعادة الغناء، بين 0.2 و1، والقيمة الافتراضية هي 1.weirdness:درجة غرابة الأسلوب، ويمكن اختيار قيمة بين 0 و1، والقيمة الافتراضية هي 0.5callback_url:عنوان URL المطلوب إرسال النتيجة إليه عبر رد الاتصال.async:اختياري، عند تعيينه إلىtrueتُرجع الواجهةtask_idفورًا دون الحاجة إلى تقديمcallback_url، ثم تُستعلم واجهة الاستعلام عن المهام المقابلة بشكل دوري للحصول على النتيجة.instrumental:ما إذا كان الوضع بلا كلمات.
بعد الاختيار، يمكن ملاحظة أن الشيفرة المقابلة قد أُنشئت أيضًا على الجانب الأيمن، كما هو موضح في الصورة:

يمكن النقر على زر «Try» لإجراء الاختبار، وكما هو موضح في الصورة أعلاه، حصلنا هنا على النتيجة التالية:
{
"success": true,
"task_id": "82fd443a-903a-4f18-8028-12d2f8a0a4be",
"trace_id": "d85839fa-0bb1-42da-a9fc-cd582c29027d",
"data": [
{
"id": "6c947f13-a3c5-4b9c-8609-5639c37cdc2d",
"title": "Untitled",
"image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
"lyric": "[Instrumental]",
"audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
"video_url": null,
"image_id": "6c947f13-a3c5-4b9c-8609-5639c37cdc2d",
"topic": null,
"seed": "2450882164",
"sound": "A song for Christmas",
"created_at": "2025-12-30T17:18:23.232911Z",
"model": "FUZZ-2.0 Pro",
"progress": "100%",
"state": "succeeded",
"duration": "181.3014058956916"
}
]
}
تحتوي النتيجة المُرجعة على عدة حقول، موضحة كما يلي:
success، حالة مهمة إنشاء الموسيقى في هذه المرحلة.data، نتيجة مهمة الموسيقى هذهid، معرّف مهمة إنشاء الموسيقى في هذه المرحلة.sound، مطالبة مهمة إنشاء الموسيقى في هذه المرحلة.seed، قيمة البذرة لمهمة إنشاء الموسيقى في هذه المرحلة.audio_url، رابط الصوت لمهمة إنشاء الموسيقى في هذه المرحلة.image_url، رابط الغلاف لمهمة إنشاء الموسيقى في هذه المرحلة.image_id، معرّف الغلاف لمهمة إنشاء الموسيقى في هذه المرحلة.state، حالة مهمة إنشاء الموسيقى في هذه المرحلة.duration، معلومات مدة الموسيقى في هذه المرحلة.progress، قيمة تقدم مهمة الموسيقى في هذه المرحلة.model، معلومات النموذج المستخدم في مهمة إنشاء الموسيقى في هذه المرحلة.lyric، معلومات كلمات الأغنية لمهمة إنشاء الموسيقى في هذه المرحلة.
يمكن ملاحظة أننا حصلنا على معلومات الموسيقى التي أردنا إنشاءها، وما علينا سوى استخدام عنوان رابط الموسيقى في data ضمن النتيجة للحصول على موسيقى Producer المُنشأة.
بالإضافة إلى ذلك، إذا أردت إنشاء شيفرة التكامل المقابلة، فيمكنك نسخ الشيفرة المُنشأة مباشرة، وعلى سبيل المثال، تكون شيفرة CURL كما يلي:
curl -X POST 'https://api.yxai-tech.top/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"action": "generate",
"model": "FUZZ-2.0 Pro",
"prompt": "A song for Christmas"
}'
¶ الإنشاء المخصص
إذا أردت إنشاء كلمات مخصصة، يمكنك إدخال الكلمات:
في هذه الحالة، يمكن تمرير محتوى مشابه لما يلي إلى الحقل lyric:
[Verse]Woke up with the sun in my eyesNo clouds above just blue in the skiesShoes on my feet I’m ready to runEvery step feels like a loaded gun[Chorus]Happy days are rolling inLet the joy beneath my skinNo more shadows no more liesJust the truth that lifts me high[Verse 2]Dancing through the city streetsA rhythm pounding in my heartbeatStrangers smile it’s catching onThis world’s a stage we’re all a song[Chorus]Happy days are rolling inLet the joy beneath my skinNo more shadows no more liesJust the truth that lifts me high[Bridge]Throw your worries out the doorLet them sink to the ocean floorWe’re alive and it’s enoughLife is messy but it’s love[Chorus]Happy days are rolling inLet the joy beneath my skinNo more shadows no more liesJust the truth that lifts me high
بعد ذلك، لتوليد أغنية مخصصة بناءً على الكلمات والعنوان والنمط، يمكن تحديد المحتوى التالي:
- lyric:نص كلمات الأغنية
- custom:تُملأ بالقيمة
true، للدلالة على التوليد المخصص، والقيمة الافتراضية لهذا المعامل هي false، للدلالة على التوليد باستخدامprompt. - title:عنوان الأغنية.
مثال على التعبئة كما يلي:

بعد الانتهاء من التعبئة، يُولَّد الكود تلقائيًا كما يلي:

الكود المقابل:
curl -X POST 'https://api.yxai-tech.top/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"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
}'
الاختبار مسموح، والنتيجة المُولَّدة مشابهة.
{
"success": true,
"task_id": "9f58bbd4-855a-4233-ac45-b63bf9168e02",
"trace_id": "145ad117-6ce7-42dd-af12-70751c5284fc",
"data": [
{
"id": "38d3b9e2-0dfb-4338-b2a7-15e45656ed32",
"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": "38d3b9e2-0dfb-4338-b2a7-15e45656ed32",
"topic": null,
"seed": "3789209121",
"sound": "",
"created_at": "2025-12-30T17:26:46.357055Z",
"model": "FUZZ-2.0 Pro",
"progress": "100%",
"state": "succeeded",
"duration": "153.80897959183673"
}
]
}
¶ إعادة غناء الأغاني
إذا أردت إعادة غناء أغنية سبق توليدها، فيمكنك إدخال الأغنية المُولَّدة أعلاه لإعادة غنائها، وبعد ذلك سنولّد أغنية مخصصة بناءً على الكلمات والعنوان.
إذا أردت إعادة غناء أغنية رفعتها بنفسك، فيمكنك تعيين المعامل action إلى upload_cover، وإدخال معرّف الأغنية المرفوعة المخصصة التي تريد إعادة غنائها، ويُحصل على معرّف الأغنية باستخدام Producer Upload API، كما هو موضح في الصورة أدناه:

يمكنك تحديد المحتوى التالي:
- action:الإجراء الخاص بمهمة الأغنية هذه، ويدعم حاليًا: generate، cover، extend، upload_cover، upload_extend، replace_section، swap_vocals، swap_instrumentals، variation، وتستخدم إعادة الغناء هذه المعامل
cover. - lyric:نص كلمات الأغنية
- title:عنوان الأغنية.
- custom:ما إذا كان التوليد يتم باستخدام الوضع المخصص، والقيمة الافتراضية هي false.
- audio_id:معرّف الأغنية المراد إعادة غنائها.
مثال على التعبئة كما يلي:

بعد الانتهاء من التعبئة، يُولَّد الكود تلقائيًا كما يلي:

الكود المقابل:
curl -X POST 'https://api.yxai-tech.top/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"action": "cover",
"model": "FUZZ-2.0 Pro",
"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_id": "38d3b9e2-0dfb-4338-b2a7-15e45656ed32",
"instrumental": false,
"custom": true,
"title": "Cover"
}'
يسمح الاختبار بذلك، والنتيجة المُولَّدة مشابهة.
{
"success": true,
"task_id": "dbca350e-6fb9-46ca-9c7e-4c1a9080806f",
"trace_id": "a39e0fff-ced8-4b31-ae23-aef3badd90fa",
"data": [
{
"id": "e52dd729-38b4-4c2f-9031-59eb7953c593",
"title": "Cover",
"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": "e52dd729-38b4-4c2f-9031-59eb7953c593",
"topic": null,
"seed": "358803418",
"sound": "",
"created_at": "2025-12-30T17:32:32.951948Z",
"model": "FUZZ-2.0 Pro",
"progress": "100%",
"state": "succeeded",
"duration": "153.0659410430839"
}
]
}
¶ استكمال الأغنية
إذا أردنا استكمال الأغنية، فنحتاج إلى تمرير قيمة المعامل action على النحو التالي: extend، وبعد ذلك نُخصّص توليد الأغنية بناءً على الكلمات والعنوان والنمط.
إذا أردنا مواصلة استكمال أغنية رفعناها بأنفسنا، فيمكننا تعيين المعامل action إلى upload_extend، وإدخال معرّف الأغنية المرفوعة المخصصة التي نريد مواصلة استكمالها. ويُحصل على معرّف الأغنية باستخدام واجهة برمجة تطبيقات رفع Producer، كما هو موضح في الصورة أدناه:

مثال التعبئة كما يلي:

بعد الانتهاء من التعبئة، يُولَّد الكود تلقائيًا كما يلي:

الكود المقابل:
curl -X POST 'https://api.yxai-tech.top/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"action": "extend",
"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",
"continue_at": 3,
"audio_id": "38d3b9e2-0dfb-4338-b2a7-15e45656ed32",
"custom": true,
"title": "Extend",
"weirdness": 0.3,
"sound_strength": 0.3,
"lyrics_strength": 0.6
}'
يسمح الاختبار بذلك، والنتيجة المُولَّدة مشابهة.
{
"success": true,
"task_id": "834983cb-d62d-4750-b1aa-461da137e51f",
"trace_id": "6923eee2-7403-432c-8bd1-e471086385b0",
"data": [
{
"id": "d9ebc609-fb65-4a23-b914-c074747af6a4",
"title": "Extend",
"image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
"lyric": "[Verse]\n[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": "d9ebc609-fb65-4a23-b914-c074747af6a4",
"topic": null,
"seed": "4294469624",
"sound": "",
"created_at": "2025-12-30T17:36:14.520928Z",
"model": "FUZZ-2.0 Pro",
"progress": "100%",
"state": "succeeded",
"duration": "173.87102040816328"
}
]
}
¶ تنويع الموسيقى
إذا أردنا توليد مقطوعة موسيقية جديدة ذات تأثير مشابه بناءً على قيمة seed للمقطوعة الموسيقية السابقة، فنحتاج إلى تمرير قيمة المعامل action على النحو التالي: variation، وبعد ذلك يمكننا تخصيص توليد مقطوعة موسيقية جديدة ذات تأثير مشابه.
مثال التعبئة كما يلي:

بعد الانتهاء من التعبئة، يُولَّد الكود تلقائيًا كما يلي:

الكود المقابل:
curl -X POST 'https://api.yxai-tech.top/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"action": "variation",
"audio_id": "d9ebc609-fb65-4a23-b914-c074747af6a4",
"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
}'
الاختبار مسموح، والنتيجة المُولَّدة مشابهة.
{
"success": true,
"task_id": "3a74da6d-a37d-4b5d-b116-821f455bce39",
"trace_id": "8e28cce0-0400-4bfd-83db-6d27f97422c7",
"data": [
{
"id": "c14ca458-cd5a-4700-83d4-5249e15f2707",
"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": "c14ca458-cd5a-4700-83d4-5249e15f2707",
"topic": null,
"seed": "2082104582",
"sound": "",
"created_at": "2025-12-30T17:48:40.135187Z",
"model": "FUZZ-2.0",
"progress": "100%",
"state": "succeeded",
"duration": "173.12798185941043"
}
]
}
¶ استبدال مقطع
إذا أردنا استبدال مقطع من الأغنية، فعلينا تمرير المعامل action بالقيمة: replace_section، ثم نحتاج إلى توليد الأغنية بشكل مخصص بناءً على الكلمات والعنوان.
إذا أردنا متابعة استبدال مقطع من أغنية رفعناها بأنفسنا، فيمكننا تعيين المعامل action إلى upload_replace_section، وإدخال معرّف الأغنية المرفوعة المخصصة التي نريد متابعة العمل عليها. ويمكن الحصول على معرّف الأغنية باستخدام واجهة Producer Upload API، كما هو موضح في الصورة التالية:

مثال على التعبئة كما يلي:

بعد الانتهاء من التعبئة، يُولَّد الكود تلقائيًا كما يلي:

الكود المقابل:
curl -X POST 'https://api.yxai-tech.top/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"action": "replace_section",
"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",
"audio_id": "d9ebc609-fb65-4a23-b914-c074747af6a4",
"replace_section_start": 3,
"replace_section_end": 70,
"custom": true
}'
الاختبار مسموح، والنتيجة المُولَّدة مشابهة.
{
"success": true,
"task_id": "3cb5ae96-01b0-4a37-afb0-e582608af56f",
"trace_id": "3ebc6f63-5093-4499-bf9b-95c239e0da4f",
"data": [
{
"id": "a54609c6-13e2-4176-be0f-4d7eebc68e1f",
"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": "a54609c6-13e2-4176-be0f-4d7eebc68e1f",
"topic": null,
"seed": "14887454",
"sound": "",
"created_at": "2025-12-30T18:01:19.907443Z",
"model": "FUZZ-2.0 Pro",
"progress": "100%",
"state": "succeeded",
"duration": "174.6140589569161"
}
]
}
¶ إعادة إنتاج المصاحبة الموسيقية
إذا أردت استخدام عملية إعادة إنتاج المصاحبة الموسيقية الرسمية، يمكنك تعيين قيمة المعلمة action إلى: swap_instrumentals، بعد ذلك سنُخصّص توليد الأغنية بناءً على الكلمات والعنوان.
مثال على التعبئة كما يلي:

بعد الانتهاء من التعبئة، يُولَّد الكود تلقائيًا كما يلي:

الكود المقابل:
curl -X POST 'https://api.yxai-tech.top/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"action": "swap_instrumentals",
"model": "FUZZ-2.0 Pro",
"weirdness": 0.6,
"prompt": "Happy",
"audio_id": "d9ebc609-fb65-4a23-b914-c074747af6a4"
}'
يسمح الاختبار بذلك، والنتيجة المُولَّدة مماثلة.
{
"success": true,
"task_id": "d17d8376-3a58-451d-a976-404719bac11d",
"trace_id": "ab596807-910a-4e30-bae2-4647895f7d0b",
"data": [
{
"id": "22d7d75c-9e0a-47a8-b22b-eea55eaa0c4b",
"title": "Extend (Sound swap)",
"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": "22d7d75c-9e0a-47a8-b22b-eea55eaa0c4b",
"topic": null,
"seed": "2157878068",
"sound": "Happy",
"created_at": "2025-12-30T18:09:49.594800Z",
"model": "FUZZ-2.0 Pro",
"progress": "100%",
"state": "succeeded",
"duration": "172.3849433106576"
}
]
}
¶ إعادة إنتاج الصوت الغنائي
إذا أردت استخدام عملية إعادة إنتاج الصوت الغنائي الرسمية، يمكنك تعيين قيمة المعلمة action إلى: swap_vocals، بعد ذلك سنُخصّص توليد الأغنية بناءً على الكلمات والعنوان والأسلوب.
مثال على التعبئة كما يلي:

بعد الانتهاء من التعبئة، يُولَّد الكود تلقائيًا كما يلي:

الكود المقابل:
curl -X POST 'https://api.yxai-tech.top/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"action": "swap_vocals",
"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",
"weirdness": 0.6,
"lyrics_strength": 0.8,
"audio_id": "d9ebc609-fb65-4a23-b914-c074747af6a4",
"custom": true
}'
يسمح الاختبار بذلك، والنتيجة المُولَّدة مماثلة.
{
"success": true,
"task_id": "a903ac38-f129-4f85-9181-b1dc5579bd32",
"trace_id": "9953af52-45e0-4808-bf13-88f0b21262c1",
"data": [
{
"id": "7b2d653b-aaaa-41b0-b737-aee4c4c5693b",
"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": "7b2d653b-aaaa-41b0-b737-aee4c4c5693b",
"topic": null,
"seed": "2484735707",
"sound": "",
"created_at": "2025-12-30T18:13:01.349875Z",
"model": "FUZZ-2.0 Pro",
"progress": "100%",
"state": "succeeded",
"duration": "173.12798185941043"
}
]
}
¶ فصل الغناء عن الموسيقى
إذا كنت ترغب في استخدام عملية فصل الغناء عن الموسيقى الرسمية، يمكنك تعيين قيمة المعامل action إلى: stems، وبعد ذلك سنفصل الغناء عن الموسيقى بناءً على معرّف الأغنية.
مثال على التعبئة كما يلي:

بعد الانتهاء من التعبئة، يُنشأ الكود التالي تلقائيًا:

الكود المقابل:
curl -X POST 'https://api.yxai-tech.top/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"action": "stems",
"audio_id": "a54609c6-13e2-4176-be0f-4d7eebc68e1f"
}'
عند تشغيل الاختبار، تكون النتيجة المُنشأة مشابهة.
{
"success": true,
"task_id": "561ac695-b4aa-47cf-978d-fb7be2b9ebfc",
"trace_id": "66d0d397-2987-4bde-84fb-a60d0023b217",
"data": [
{
"title": "Woke up with the sun in my eyes",
"lyric": "",
"stems_url": "https://platform.cdn.acedata.cloud/producer/561ac695-b4aa-47cf-978d-fb7be2b9ebfc.zip",
"model": "",
"progress": "100%",
"state": "succeeded"
}
]
}
¶ رد الاتصال غير المتزامن
نظرًا إلى أن عملية التوليد عبر Producer Audios Generation API قد تستغرق وقتًا طويلًا نسبيًا في بعض الأحيان، فإذا لم تستجب واجهة API لفترة طويلة، فسيظل طلب HTTP متصلًا، مما يؤدي إلى استهلاك إضافي لموارد النظام، لذا توفر واجهة API هذه أيضًا دعمًا لرد الاتصال غير المتزامن.
تسير العملية بشكل عام على النحو التالي: عند إرسال العميل للطلب، يحدد حقلًا إضافيًا باسم callback_url، وبعد إرسال العميل لطلب API، ستُرجع واجهة API نتيجة فورًا تحتوي على حقل task_id، الذي يمثل معرّف المهمة الحالية. وعند اكتمال المهمة، ستُرسل نتيجة مهمة التوليد بصيغة POST JSON إلى callback_url الذي حدده العميل، وتتضمن أيضًا حقل task_id، وبذلك يمكن ربط نتيجة المهمة باستخدام المعرّف.
فيما يلي، سنستعين بمثال لفهم كيفية تنفيذ ذلك بالتفصيل.
أولًا، رد اتصال Webhook هو خدمة يمكنها استقبال طلبات HTTP، وينبغي للمطور استبداله بعنوان URL لخادم HTTP الذي أنشأه بنفسه. ولتسهيل العرض هنا، نستخدم موقعًا عامًا نموذجيًا لـ Webhook وهو https://webhook.site/، ويمكن الحصول على عنوان Webhook URL بمجرد فتح الموقع، كما هو موضح في الصورة:

يمكن نسخ عنوان URL هذا واستخدامه بوصفه Webhook، والمثال هنا هو https://webhook.site/#!/view/0d73431d-f833-4be4-9276-b6e1690d55c1.
بعد ذلك، يمكننا تعيين الحقل callback_url إلى عنوان Webhook URL المذكور أعلاه، مع إدخال المعاملات المناسبة، وتظهر التفاصيل في الصورة:

عند النقر على تشغيل، ستلاحظ الحصول على نتيجة فورًا، كما يلي:
{
"task_id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad"
}
بعد الانتظار قليلًا، يمكننا ملاحظة نتيجة مهمة التوليد على https://webhook.site/#!/view/0d73431d-f833-4be4-9276-b6e1690d55c1، كما هو موضح في الصورة:

المحتوى كما يلي:
{
"success": true,
"task_id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
"trace_id": "1da03537-4eb8-410d-b849-43f03085a3bb",
"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"
}
]
}
يمكن ملاحظة وجود حقل task_id في النتيجة، أما الحقول الأخرى فهي مشابهة لما سبق، ويمكن ربط المهمة باستخدام هذا الحقل.
¶ معالجة الأخطاء
عند استدعاء واجهة 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 Audios Generation API لتوليد الموسيقى عبر إدخال كلمات توجيهية. نأمل أن يساعدك هذا المستند على دمج واجهة API واستخدامها بصورة أفضل. إذا كانت لديك أي أسئلة، فلا تتردد في التواصل مع فريق الدعم الفني لدينا.

