إنشاء عملية moderation
استخدم CometAPI POST /v1/moderations للتحقق من النص أو المدخلات متعددة الوسائط باستخدام طلب moderation متوافق مع OpenAI.
model وقيمة input.
Authorization: Bearer $COMETAPI_KEY.نص الطلب
omni-moderation-latest. يجب أن تكون روابط الصور العامة قابلة للتنزيل بواسطة خوادم CometAPI. ولإجراء اختبار صورة قابل للنسخ، استخدم عنوان URL للبيانات بصيغة base64.
أمثلة الطلب
أرسل سلسلة نصية واحدة عندما تحتاج فقط إلى تصنيف إدخال نصي واحد:شكل الاستجابة
تتضمن الاستجابةid وmodel وresults وusage. يوضّح كل عنصر في results ما إذا كان الإدخال المطابق قد تم وضع علامة عليه، وقيم الفئات المنطقية، ودرجات الفئات، وأنواع الإدخال المطبقة على كل فئة. بالنسبة إلى طلب نصي دفعي، يحتوي results على عنصر واحد لكل سلسلة إدخال. استخدم usage لحقول الفوترة والمراقبة.التفويضات
CometAPI API key used for model requests. Send it as Authorization: Bearer $COMETAPI_KEY.
الجسم
Required moderation model ID. Use omni-moderation-latest for text and image moderation unless you have a specific moderation model requirement.
"omni-moderation-latest"
Content to check. Use a string for one text input, an array of strings for batch text checks, or OpenAI-style multimodal parts such as text plus image_url when the selected model supports it.
"I want to check this text before sending it to a model."
الاستجابة
Moderation decisions and token usage.