> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# إنشاء كلام

> إنشاء صوت TTS من النص باستخدام الصوت والتنسيق المحددين.

## مطابقة الأصوات

تُوحّد قيمة `voice` حسب المزوّد باستخدام خريطة أسماء بديلة داخلية:

* `openai`: أصوات شائعة (مثل `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `cedar`, `marin`).
* `google` (AI Studio / Gemini TTS): الأصوات الجاهزة المعتمدة:
  `Zephyr`, `Puck`, `Charon`, `Kore`, `Fenrir`, `Leda`, `Orus`, `Aoede`, `Callirrhoe`, `Autonoe`, `Enceladus`, `Iapetus`, `Umbriel`, `Algieba`, `Despina`, `Erinome`, `Algenib`, `Rasalgethi`, `Laomedeia`, `Achernar`, `Alnilam`, `Schedar`, `Gacrux`, `Pulcherrima`, `Achird`, `Zubenelgenubi`, `Vindemiatrix`, `Sadachbia`, `Sadaltager`, `Sulafat`.
* `elevenlabs`: تُطابق أصوات البداية العامة الشائعة (مثل `rachel`, `domi`, `bella`, `antoni`, `elli`, `josh`, `arnold`, `adam`, `sam`).

مع `eleven-labs/eleven-v4` و`eleven-labs/eleven-v4-turbo`، مرّر أي معرّف من 20 محرفًا من مكتبة أصوات ElevenLabs، بما في ذلك نسخة صوتية مخصصة. اضبط `config.elevenlabs.voice_settings.stability` و`similarity_boost` حسب الحاجة. لا يدعم Eleven v4 الحقلين `speed` و`voice_settings.style`.

إذا لم تكن قيمة `voice` صالحة لمزيج المزوّد والنموذج المحدد للمسار، فسيُرجع الطلب `400 invalid_request_error` مع `param: "voice"`.

## تجاوزات المزوّد

يمكنك أيضًا تمرير إعدادات الصوت الخاصة بالمزوّد:

* ElevenLabs: `config.elevenlabs.voice_id` / `config.elevenlabs.voice` / `config.elevenlabs.voiceName`
* Google: `config.google.voice_name` / `config.google.voiceName`

اجعل `voice` في المستوى الأعلى هو القيمة الافتراضية لتسهيل النقل.

## عينات الأصوات

* OpenAI: [openai.fm](https://www.openai.fm/)
* أمثلة على أصوات Google TTS: [مستندات Gemini لتحويل النص إلى كلام](https://ai.google.dev/gemini-api/docs/speech-generation#voices)
* مكتبة أصوات ElevenLabs: [ElevenLabs Voice Library](https://elevenlabs.io/voice-library)


## OpenAPI

````yaml ar/openapi/v1/openapi.localized.yaml POST /audio/speech
openapi: 3.0.3
info:
  title: Phaseo Gateway API
  description: >-
    واجهة API للبوابة تتيح الوصول إلى نماذج ذكاء اصطناعي متنوعة عبر نقاط نهاية
    متوافقة مع OpenAI.
  version: 1.0.0
  contact:
    name: Phaseo
    url: https://phaseo.app
    email: danielbutler500@gmail.com
servers:
  - url: https://api.phaseo.app/v1
    description: التوجيه العالمي
security:
  - BearerAuth: []
tags:
  - name: Gateway
    description: Core Phaseo Gateway operations.
paths:
  /audio/speech:
    post:
      tags:
        - Gateway
      summary: إنشاء كلام صوتي
      description: ينشئ صوتًا من النص المُدخل.
      operationId: createSpeech
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AudioSpeechRequest'
      responses:
        '200':
          description: ملف صوتي
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
components:
  schemas:
    AudioSpeechRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
        input:
          type: string
        voice:
          type: string
        speed:
          type: number
          minimum: 0.25
          maximum: 4
        format:
          type: string
          enum:
            - mp3
            - wav
            - ogg
            - aac
        provider:
          $ref: '#/components/schemas/ProviderRoutingOptions'
        config:
          type: object
          additionalProperties: true
          properties:
            elevenlabs:
              type: object
              additionalProperties: true
              properties:
                voice_id:
                  type: string
                language_code:
                  type: string
                output_format:
                  type: string
                voice_settings:
                  type: object
                  additionalProperties: true
                  properties:
                    stability:
                      type: number
                    similarity_boost:
                      type: number
    ProviderRoutingOptions:
      type: object
      description: تفضيلات توجيه المزوّد لاختياره عبر البوابة.
      properties:
        order:
          type: array
          items:
            type: string
        only:
          type: array
          items:
            type: string
        ignore:
          type: array
          items:
            type: string
        include_alpha:
          type: boolean
          description: تضمين مزوّدي alpha في التوجيه (معطّل افتراضيًا).
        allow_fallbacks:
          type: boolean
          nullable: true
          description: السماح بالتحويل إلى مزوّد مؤهل آخر بعد الفشل.
        require_parameters:
          type: boolean
          nullable: true
          description: اشتراط دعم المزوّد للمعلمات المطلوبة قبل التوجيه.
        required_execution_region:
          type: string
          nullable: true
          description: قصر التوجيه على المزوّدين الذين لديهم منطقة التنفيذ المطلوبة.
        required_data_region:
          type: string
          nullable: true
          description: قصر التوجيه على المزوّدين الذين لديهم منطقة البيانات المطلوبة.
        require_zero_data_retention:
          type: boolean
          nullable: true
          description: >-
            قصر التوجيه على المزوّدين الذين يدعمون الاحتفاظ بالبيانات لمدة
            صفرية.
        data_collection:
          type: string
          nullable: true
          enum:
            - allow
            - deny
        zdr:
          type: boolean
          nullable: true
        enforce_distillable_text:
          type: boolean
          nullable: true
        quantizations:
          type: array
          nullable: true
          items:
            type: string
        sort:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
          description: >-
            رتّب المزوّدين لهذا الطلب، مثلاً حسب السعر أو زمن الاستجابة أو معدل
            النقل.
        max_price:
          type: object
          properties:
            prompt:
              oneOf:
                - type: number
                - type: string
            completion:
              oneOf:
                - type: number
                - type: string
            image:
              oneOf:
                - type: number
                - type: string
            audio:
              oneOf:
                - type: number
                - type: string
            request:
              oneOf:
                - type: number
                - type: string
        preferred_min_throughput:
          oneOf:
            - type: number
            - type: object
              additionalProperties:
                type: number
        preferred_max_latency:
          oneOf:
            - type: number
            - type: object
              additionalProperties:
                type: number
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: المصادقة باستخدام رمز Bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.