Skip to main content
POST
Synthesize speech

Authorizations

Authorization
string
header
required

Your AI Reserve API key (aireserve_api_…) from the API Keys page in the portal (https://portal.aireserve.com/keys).

Body

application/json
model
enum<string>
required

TTS model. grok-tts is served by xAI; the eleven-* models by ElevenLabs (eleven-v4 is the most expressive, eleven-flash-v2-5 the fastest and half the price).

Available options:
grok-tts,
eleven-v4,
eleven-v3,
eleven-multilingual-v2,
eleven-flash-v2-5
input
string
required

Text to synthesize, counted in Unicode code points. Per-model ceiling: 4,096 for grok-tts, 10,000 for eleven-v4 and eleven-multilingual-v2, 5,000 for eleven-v3, 40,000 for eleven-flash-v2-5.

Maximum string length: 40000
voice
string
required

Built-in voice ID from GET /v1/voices (ElevenLabs voices also accept their name, e.g. George) or your organization's custom voice ID from GET /v1/custom-voices (custom voices are grok-tts only).

language
string

Language hint (e.g. en, en-US, es). xAI: defaults to the voice's primary language. ElevenLabs: forwarded as an ISO 639-1 language_code on the models that accept one (ignored by eleven-multilingual-v2, which detects the language from the text).

response_format
enum<string>

Output format. grok-tts emits mp3 only. The eleven-* models emit mp3 (44.1 kHz, 128 kbps), opus (48 kHz, 128 kbps), pcm (24 kHz 16-bit mono LE) or wav (24 kHz). Defaults to mp3.

Available options:
mp3,
opus,
pcm,
wav
speed
number

Playback speed (ElevenLabs models only). 1.0 is normal; grok-tts rejects this field.

Required range: 0.7 <= x <= 1.2

Response

Raw MP3 audio stream.

The response is of type file.