> ## Documentation Index
> Fetch the complete documentation index at: https://edenai-feat-automate-documentation-tests.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Audio Speech

> OpenAI-compatible text-to-speech endpoint.

Accepts a JSON body (``model``, ``input``, ``voice`` plus optional
``response_format`` / ``speed`` / ``instructions``) and returns raw audio
bytes; ``cost`` and ``provider`` are returned in the ``x-edenai-*`` response
headers.



## OpenAPI

````yaml https://api.edenai.run/v3/docs/openapi.json post /v3/audio/speech
openapi: 3.1.0
info:
  title: Eden AI API V3
  version: 3.0.0
servers:
  - url: https://api.edenai.run
    description: Production server
security: []
paths:
  /v3/audio/speech:
    post:
      tags:
        - Audio
      summary: Audio Speech
      description: >-
        OpenAI-compatible text-to-speech endpoint.


        Accepts a JSON body (``model``, ``input``, ``voice`` plus optional

        ``response_format`` / ``speed`` / ``instructions``) and returns raw
        audio

        bytes; ``cost`` and ``provider`` are returned in the ``x-edenai-*``
        response

        headers.
      operationId: audio_speech_v3_audio_speech_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpeechBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
            audio/mpeg:
              schema:
                type: string
                format: binary
            audio/ogg:
              schema:
                type: string
                format: binary
            audio/aac:
              schema:
                type: string
                format: binary
            audio/flac:
              schema:
                type: string
                format: binary
            audio/wav:
              schema:
                type: string
                format: binary
            audio/pcm:
              schema:
                type: string
                format: binary
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - AuthBearer: []
components:
  schemas:
    SpeechBody:
      properties:
        model:
          type: string
          title: Model
          description: provider/model, e.g. 'openai/tts-1'
        input:
          type: string
          title: Input
          description: The text to synthesize into audio.
        voice:
          type: string
          title: Voice
          description: Voice preset, e.g. 'alloy'.
        response_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Response Format
          description: >-
            Audio format: 'mp3', 'opus', 'aac', 'flac', 'wav', or 'pcm'.
            Defaults to 'mp3'. Note: Gemini TTS models always return WAV and
            ignore this field.
        speed:
          anyOf:
            - type: number
            - type: 'null'
          title: Speed
          description: >-
            Playback speed. OpenAI/Azure TTS accept 0.25-4.0; other providers
            may use a different range or ignore it.
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
          description: Optional guidance for voice and delivery style.
      type: object
      required:
        - model
        - input
        - voice
      title: SpeechBody
      description: |-
        OpenAI-compatible text-to-speech request.

        Synthesizes ``input`` text into audio with the given ``voice``. Unknown
        top-level fields are dropped.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    AuthBearer:
      type: http
      scheme: bearer

````