---
title: "Text-to-speech"
method: POST
path: "/audio/speech"
tags: ["audio"]
---

# Text-to-speech

`POST /audio/speech`

## Request

- Base URL: `https://api.krater.ai/v1`
- URL: `https://api.krater.ai/v1/audio/speech`
- Auth: HTTP bearer

Convert text to spoken audio. Supports OpenAI voices (tts-1, tts-1-hd) and ElevenLabs voices. Returns binary audio.

## Request body

- SpeechRequest
  - `input` string, required: The text to convert to speech.
  - `voice` string: Voice name (OpenAI voices like alloy) or ElevenLabs voice ID.
  - `model` string: TTS model.
  - `speed` number: Playback speed multiplier.

## Response `200`

Binary audio data.

## Other responses

- `400`: Invalid request body or parameters.
- `401`: Missing or invalid API key. Pass Authorization: Bearer kr_live_...
- `402`: Not enough credits, or the API key's daily credit cap is reached.
- `429`: Rate limit exceeded (default 60 requests per minute per key). Includes a Retry-After header.

---

[API](https://skmtc.dev/krater/apis/krater-api.md) - [All operations](https://skmtc.dev/krater/apis/krater-api/llms.txt) - [OpenAPI document](https://skmtc.dev/krater/apis/krater-api/revisions/66005541188c?raw)
