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

# Create speech

`POST /v1/audio/speech`

## Request

- Base URL: `https://api.tokenlab.sh`
- URL: `https://api.tokenlab.sh/v1/audio/speech`
- Auth: HTTP bearer

Generates audio from the input text (Text-to-Speech).

## Headers

- `X-TokenLab-Delivery-Policy` 'auto' | 'verified' | 'official'

## Request body

- AudioSpeechRequest
  - `model` string, required: TTS model. There is no default model. Query GET /v1/models?recommended_for=tts for the current shortlist.
  - `input` string, required: Text to synthesize.
  - `voice` union: Voice selector for OpenAI-compatible, Gemini, xAI, and MiniMax-compatible speech models. Some MiniMax models also accept voice_id.
    - string
    - object
      - `id` string, required
  - `voice_id` string: Voice selector for MiniMax-compatible speech models.
  - `instructions` string: Optional style or delivery instructions for OpenAI-compatible TTS models that support them.
  - `prompt` string: Optional speaking style prompt for Gemini TTS models.
  - `language_code` string: Optional language code for Gemini, xAI, and compatible TTS models.
  - `response_format` string: Audio format. Common values include mp3, opus, aac, flac, wav, and pcm. Supported values vary by model family.
  - `stream_format` 'audio' | 'sse': TokenLab delivery format.
  - `speed` number: Speech speed for model families that support it.
  - `temperature` number: Sampling temperature for Gemini-compatible TTS models.

## Response `200`

Audio file

## Other responses

- `400`: Bad Request - Invalid input
- `401`: Unauthorized - Invalid or missing API key
- `402`: Payment Required - Insufficient balance or quota exceeded
- `429`: Rate Limit Exceeded
- `500`: Internal Server Error
- `503`: The requested Delivery tier is temporarily unavailable.

---

[API](https://skmtc.dev/tokenlab/apis/tokenlab-ai-gateway.md) · [All operations](https://skmtc.dev/tokenlab/apis/tokenlab-ai-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/tokenlab/apis/tokenlab-ai-gateway/revisions/3208bfbcda22?raw)
