> ## 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 Audio

> GPT Audio: audio conversation model with speech input and output. Request examples and parameters for MixRoute.

GPT Audio is an audio conversation model with speech input and output from OpenAI.

Call `gpt-audio` through MixRoute using the endpoint shown below.

## Key capabilities

* Audio input and output - Use speech as part of a Chat Completions conversation
* Voice selection - Configure the voice used for generated audio
* Text transcript - Receive text alongside generated audio
* OpenAI-compatible - Uses the Chat Completions request format

## Quick example

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.mixroute.ai/v1/chat/completions" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "model": "gpt-audio",
      "modalities": [
        "text",
        "audio"
      ],
      "audio": {
        "voice": "alloy",
        "format": "wav"
      },
      "messages": [
        {
          "role": "user",
          "content": "Give a short spoken welcome to MixRoute."
        }
      ],
      "max_completion_tokens": 256
    }'
    ```
  </Tab>

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

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

    response = client.chat.completions.create(
        model="gpt-audio",
        modalities=["text", "audio"],
        audio={"voice": "alloy", "format": "wav"},
        messages=[{"role": "user", "content": "Give a short spoken welcome to MixRoute."}],
        max_completion_tokens=256,
    )

    audio = response.choices[0].message.audio
    Path("reply.wav").write_bytes(base64.b64decode(audio.data))
    print(audio.transcript)
    ```
  </Tab>
</Tabs>

## Parameters

| Parameter               | Type    | Required | Description                                                            |
| ----------------------- | ------- | -------- | ---------------------------------------------------------------------- |
| `model`                 | string  | Yes      | Must be `gpt-audio`.                                                   |
| `messages`              | array   | Yes      | Conversation messages. Content may include text or input\_audio parts. |
| `modalities`            | array   | Yes      | Include audio to request generated speech.                             |
| `audio`                 | object  | Yes      | Output voice and audio format.                                         |
| `max_completion_tokens` | integer | No       | Maximum generated tokens.                                              |
| `stream`                | boolean | No       | Enable streamed Chat Completions output.                               |
