---
title: "/v1/audio/speech"
method: POST
path: "/v1/audio/speech"
tags: ["OpenAI · Audio"]
---

# /v1/audio/speech

`POST /v1/audio/speech`

## Request

- Base URL: `https://aihubmix.com`
- URL: `https://aihubmix.com/v1/audio/speech`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/inferera/apis/aihubmix-gateway-api/docs/v1/audio/speech/post.ts> (a function with typed inputs; its response is checked against the schema)

Generates audio from the input text.

Returns the audio file content, or a stream of audio events.

## Request body

- CreateSpeechRequest
  - `model` union, required: One of the available [TTS models](/docs/models#tts): `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.
    - string
    - 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts' | 'gpt-4o-mini-tts-2025-12-15'
  - `input` string, required: The text to generate audio for. The maximum length is 4096 characters.
  - `instructions` string: Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`.
  - `voice` union, required: A built-in voice name or a custom voice reference.
    - string
    - 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse' | 'marin' | 'cedar'
    - object: Custom voice reference.
      - `id` string, required: The custom voice ID, e.g. `voice_1234`.
  - `response_format` 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm': The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`.
  - `speed` number: The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default.
  - `stream_format` 'sse' | 'audio': The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`.

## Response `200`

OK

## Other responses

- `400`: Invalid request
- `401`: Authentication failed
- `403`: Permission denied
- `404`: Not found
- `429`: Rate limited
- `5XX`: Server / upstream error

---

[API](https://skmtc.dev/inferera/apis/aihubmix-gateway-api.md) - [All operations](https://skmtc.dev/inferera/apis/aihubmix-gateway-api/llms.txt) - [OpenAPI document](https://skmtc.dev/inferera/apis/aihubmix-gateway-api/revisions/f293fe0500c2?raw)
