---
title: "Text to speech (OpenAI-compatible)"
method: POST
path: "/api/v1/audio/speech"
tags: ["OpenAI-compatible"]
---

# Text to speech (OpenAI-compatible)

`POST /api/v1/audio/speech`

## Request

- Base URL: `https://api.llm-broker.net`
- URL: `https://api.llm-broker.net/api/v1/audio/speech`
- Auth: API key in header `Authorization`

Streams audio. Unknown `voice` answers 400 `unknown_voice` with the list of voices.

## Request body

- object
  - `input` string, required
  - `language` string
  - `response_format` 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm'
  - `voice` string

## Response `200`

Audio (mp3 by default; wav/pcm stream)

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key
- `402`: Insufficient balance

---

[API](https://skmtc.dev/llm-broker/apis/astrioncore-core-api.md) · [All operations](https://skmtc.dev/llm-broker/apis/astrioncore-core-api/llms.txt) · [OpenAPI document](https://skmtc.dev/llm-broker/apis/astrioncore-core-api/revisions/f85835487bf5?raw)
