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

# Text to speech



## OpenAPI

````yaml /api-reference/openapi.json post /v1/audio/speech
openapi: 3.1.0
info:
  title: SynapsAI Inference API
  version: 1.0.0
servers:
  - url: https://api.synapsai.cloud
    description: Production server
security: []
paths:
  /v1/audio/speech:
    post:
      summary: Text to speech
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AudioSpeechRequest'
      responses:
        '200':
          description: Audio bytes in requested response_format
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
            application/json:
              schema:
                type: string
                format: binary
components:
  schemas:
    AudioSpeechRequest:
      allOf:
        - type: object
          description: Request body for text-to-speech conversion.
          properties:
            input:
              type: string
              description: Text to convert into speech. Required.
            language:
              type: string
              nullable: true
              description: Optional language code to control language/voice selection.
            response_format:
              type: string
              enum:
                - mp3
                - wav
                - opus
                - flac
                - aac
              default: mp3
              description: Desired audio format for the returned speech.
            speed:
              type: number
              default: 1
              description: >-
                Playback speed multiplier for the generated speech (1.0 =
                normal).
            stream_format:
              type: string
              enum:
                - sse
                - audio
              default: audio
              description: >-
                Whether the response will be streamed as SSE or returned as raw
                audio.
          required:
            - input

````