---
title: "Create speech"
method: POST
path: "/v1/audio/speech"
---

# Create speech

`POST /v1/audio/speech`

Generates audio from input text (text-to-speech). Returns the audio file as binary data.

## Request body

- object
  - `model` string, required — ID of the speech generation (text-to-speech) model to use.
  - `input` string, required — The text to synthesize into speech.
  - `voice` string — The prebuilt voice to use. Defaults to the model's default voice when omitted.
  - `response_format` 'wav' | 'pcm' | 'mp3' | 'opus' | 'aac' | 'flac' — The audio format of the returned audio. OpenAI models support mp3 (default), opus, aac, flac, wav and pcm. Gemini models emit PCM, so only wav (default) and pcm are supported.
  - `speed` number — Playback speed hint. Forwarded to OpenAI models; not applied by Gemini speech models.
  - `instructions` string — Optional style/delivery instructions prepended to the input as a natural-language directive (e.g. 'Say cheerfully').

## Response `200`

Generated audio.

## Other responses

- `400` — Invalid request body or parameters.
- `401` — Unauthorized request.
- `402` — Payment required / insufficient credits.
- `403` — Forbidden.
- `500` — Internal server error.
- `502` — Failed to connect to the upstream provider.
- `504` — Upstream provider timeout.

---

[API](https://skmtc.dev/llmgateway/apis/llmgateway-api.md) · [All operations](https://skmtc.dev/llmgateway/apis/llmgateway-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/llmgateway/llmgateway-api/revisions/aaf167e3d8cc/schema)
