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

# Generate Speech

> Generates audio from the input text.



## OpenAPI

````yaml /gateway-openapi.json post /audio/speech
openapi: 3.0.0
info:
  title: LLM Gateway
  description: API for LLM Gateway
  version: 1.0.0
servers:
  - url: https://{gatewayBaseURL}
    variables:
      gatewayBaseURL:
        default: gateway.truefoundry.ai
        description: Gateway base URL
    description: Gateway base URL
security:
  - AuthorizationBearer: []
tags:
  - name: Chat
  - name: Agent
  - name: Messages
  - name: MCP
  - name: Embeddings
  - name: Rerank
  - name: Responses
  - name: Image
  - name: Audio
  - name: Batch
  - name: Files
  - name: Fine-tuning
  - name: Moderations
  - name: Models
paths:
  /audio/speech:
    post:
      tags:
        - Audio
      summary: Generate Speech
      description: Generates audio from the input text.
      parameters:
        - schema:
            type: string
            description: Optional metadata for the request
          required: false
          name: x-tfy-metadata
          in: header
      requestBody:
        required: true
        description: Text to convert to speech and speech generation options
        content:
          application/json:
            schema:
              type: object
              properties:
                input:
                  type: string
                  description: >-
                    The text to generate audio for. The maximum length is 4096
                    characters.
                model:
                  type: string
                  description: >-
                    The TTS model to use (e.g. tts-1, tts-1-hd,
                    gpt-4o-mini-tts).
                voice:
                  anyOf:
                    - type: string
                    - type: object
                      properties:
                        name:
                          type: string
                          description: Voice name in the provider's naming scheme.
                        languageCode:
                          type: string
                          description: BCP-47 language code (e.g. en-US).
                      required:
                        - name
                        - languageCode
                  description: >-
                    The voice to use for single-speaker TTS. Can be a string
                    (OpenAI format: alloy, ash, ballad, coral, echo, fable,
                    onyx, nova, sage, shimmer, verse) or an object with name and
                    languageCode (Vertex AI format).
                instructions:
                  type: string
                  nullable: true
                  description: >-
                    Control the voice of your generated audio with additional
                    instructions. Does not work with tts-1 or tts-1-hd.
                response_format:
                  type: string
                  nullable: true
                  description: >-
                    The format to audio in. Supported formats are mp3, opus,
                    aac, flac, wav, and pcm. Default: mp3.
                speed:
                  type: number
                  nullable: true
                  description: >-
                    The speed of the generated audio. Select a value from 0.25
                    to 4.0. Default: 1.0.
                stream_format:
                  type: string
                  nullable: true
                  description: >-
                    The format to stream the audio in. Supported formats are sse
                    and audio. sse is not supported for tts-1 or tts-1-hd.
                    Default: audio.
              required:
                - input
                - model
      responses:
        '200':
          description: Audio generated successfully
          content:
            audio/*:
              schema:
                type: string
                description: The audio file content
        '400':
          description: Bad Request
components:
  securitySchemes:
    AuthorizationBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````