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

# GPT-4o Mini TTS

> GPT-4o Mini TTS: text-to-speech model. Request examples and parameters for MixRoute.

GPT-4o Mini TTS is a text-to-speech model from OpenAI.

Call `gpt-4o-mini-tts` through MixRoute using the endpoint shown below.

## Key capabilities

* Text-to-speech - Convert text into generated audio
* Voice selection - Configure a prebuilt voice
* Audio output - Returns generated speech data

## Quick example

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.mixroute.ai/v1/audio/speech" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "model": "gpt-4o-mini-tts",
      "voice": "alloy",
      "input": "Welcome to MixRoute.",
      "response_format": "wav"
    }' \
      --output speech.wav
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    from pathlib import Path
    from openai import OpenAI

    client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.mixroute.ai/v1")

    with client.audio.speech.with_streaming_response.create(
        model="gpt-4o-mini-tts",
        voice="alloy",
        input="Welcome to MixRoute.",
        response_format="wav",
    ) as response:
        response.stream_to_file(Path("speech.wav"))
    ```
  </Tab>
</Tabs>

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `model` | string | Yes | Must be `gpt-4o-mini-tts`. |
| `input` | string | Yes | Text to synthesize. |
| `voice` | string | Yes | Voice used for speech generation. |
| `response_format` | string | No | Audio output format. |


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