curl --request POST \
--url https://api.aireserve.com/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok-tts",
"input": "Welcome to AI Reserve. How can I help you today?",
"voice": "ara",
"language": "en"
}
'import requests
url = "https://api.aireserve.com/v1/audio/speech"
payload = {
"model": "grok-tts",
"input": "Welcome to AI Reserve. How can I help you today?",
"voice": "ara",
"language": "en"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'grok-tts',
input: 'Welcome to AI Reserve. How can I help you today?',
voice: 'ara',
language: 'en'
})
};
fetch('https://api.aireserve.com/v1/audio/speech', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));"<string>"Synthesize speech
Synthesize speech from text. Models: grok-tts (xAI; max 4,096 characters, mp3 only) and the ElevenLabs models eleven-v4 (10,000 characters), eleven-v3 (5,000), eleven-multilingual-v2 (10,000) and eleven-flash-v2-5 (40,000), which also accept opus, pcm and wav output and a speed of 0.7–1.2. Synchronous — returns raw audio bytes (audio/mpeg by default). Billed per Unicode code point at the model’s rate. Use a built-in voice ID or ElevenLabs voice name from GET /v1/voices, or a custom voice ID from GET /v1/custom-voices (custom voices are grok-tts only).
curl --request POST \
--url https://api.aireserve.com/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok-tts",
"input": "Welcome to AI Reserve. How can I help you today?",
"voice": "ara",
"language": "en"
}
'import requests
url = "https://api.aireserve.com/v1/audio/speech"
payload = {
"model": "grok-tts",
"input": "Welcome to AI Reserve. How can I help you today?",
"voice": "ara",
"language": "en"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'grok-tts',
input: 'Welcome to AI Reserve. How can I help you today?',
voice: 'ara',
language: 'en'
})
};
fetch('https://api.aireserve.com/v1/audio/speech', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));"<string>"Authorizations
Your AI Reserve API key (aireserve_api_…) from the API Keys page in the portal (https://portal.aireserve.com/keys).
Body
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).
grok-tts, eleven-v4, eleven-v3, eleven-multilingual-v2, eleven-flash-v2-5 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.
40000Built-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 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).
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.
mp3, opus, pcm, wav Playback speed (ElevenLabs models only). 1.0 is normal; grok-tts rejects this field.
0.7 <= x <= 1.2Response
Raw MP3 audio stream.
The response is of type file.