curl --request POST \
--url https://api.modellix.ai/api/v1/xai/grok-voice-tts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello! Welcome to the xAI Text to Speech API.",
"language": "en"
}
'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-grok-voice-tts-001",
"model_id": "xai/grok-voice-tts",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-grok-voice-tts-001"
}
}
}Grok Voice TTS
[Core Function] Grok Voice TTS converts text into natural spoken audio with expressive voices and optional speech tags embedded in the text. [Strengths] Supports 20+ languages (plus auto-detect), 26 built-in voices, multiple codecs (mp3/wav/pcm/mulaw/alaw), and custom voice IDs. [Best For] Product voiceovers, IVR/telephony (mulaw/alaw), and multilingual narration. [Limitations] Do NOT exceed 15,000 characters per request. Audio is returned on the completed task after polling. [Routing] Use this model for xAI Grok Voice quality or custom cloned voices. [Built-in voices] Original: eve (default), ara, leo, rex, sal. Flagship: altair, atlas, carina, castor, celeste, cosmo, helios, helix, iris, kepler, lumen, luna, lux, naksh, orion, perseus, rigel, sirius, ursa, zagan, zenith — case-insensitive; custom voice IDs are also accepted as voice_id.
curl --request POST \
--url https://api.modellix.ai/api/v1/xai/grok-voice-tts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello! Welcome to the xAI Text to Speech API.",
"language": "en"
}
'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-grok-voice-tts-001",
"model_id": "xai/grok-voice-tts",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-grok-voice-tts-001"
}
}
}Authorizations
Body
Text to synthesize (max 15,000 characters). Supports inline speech tags such as [pause], [laugh], and wrapping tags like ....
1 - 15000Voice ID for synthesis. Built-in voices are listed below (26 total, case-insensitive). Custom voice IDs from your xAI voice library are also accepted.
eve, ara, leo, rex, sal, altair, atlas, carina, castor, celeste, cosmo, helios, helix, iris, kepler, lumen, luna, lux, naksh, orion, perseus, rigel, sirius, ursa, zagan, zenith Response
Task submitted successfully. Poll GET /api/v1/tasks/{task_id} until the task completes; synthesized audio is returned on the task result.
Response object for asynchronous task submission.