دليل المستخدم مرجع الواجهة البرمجية (API)

قائمة الأصوات

استرجاع الأصوات المتاحة لتحويل النص إلى كلام

POST /api/v1/voices/

يرجع قائمة بجميع الأصوات المسموح للمستخدم المصرح له باستخدامها مع واجهة برمجة تطبيقات تحويل النص إلى كلام.

المصادقة

قم بتضمين مفتاح API الخاص بك في ترويسة Authorization بتنسيق Bearer YOUR_API_KEY.

الاستجابة

الحقل النوع الوصف
voice_id عدد صحيح (integer) معرف صوت فريد
voice_name نص (string) اسم عرض الصوت
voice_sample_url نص (string) رابط ملف عينة الصوت
voice_fees عدد عشري (float) رسوم استخدام هذا الصوت (0 تعني مجاني)
voice_badges كائن (object) بيانات وصفية إضافية للصوت، مثل اللغة، الجنس، العمر، وحالة الاستخدام

مثال

curl "https://moknah.io/api/v1/voices/" \
  -H "Authorization: Bearer YOUR_API_KEY"
import requests

response = requests.post(
    "https://moknah.io/api/v1/voices/",
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)

voices = response.json()
for voice in voices:
    print(voice["voice_name"], voice["voice_sample_url"])
const response = await fetch(
    'https://moknah.io/api/v1/voices/',
    {
        headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    }
);

const voices = await response.json();
console.log(voices);

مثال للاستجابة

[
    {
        "voice_id": 1328,
        "voice_name": "Adnan",
        "voice_sample_url": "https://storage.moknah.io/media/voice_samples/Adnan.mp3",
        "voice_fees": 0.0,
        "voice_badges": {
            "language": "Arabic",
            "gender": "Male",
            "age": "Young Adult",
            "use_case": "Documentary, Audiobook, Article",
        }
    }
]
دعم واجهة برمجة التطبيقات (API)

للأسئلة أو المشكلات المتعلقة بواجهة برمجة التطبيقات، اتصل بنا على api@moknah.io.