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
xAI’s text-to-speech model for voiceovers, narration, and phone audio, with expressive delivery and inline speech tags such as pauses and whispers. It speaks multiple languages, including Chinese, Japanese, and Spanish, through built-in voices or a custom voice.
POST
/
xai
/
grok-voice-tts
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
application/json
Text to synthesize (max 15,000 characters). Supports inline speech tags such as [pause], [laugh], and wrapping tags like ....
Required string length:
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.
Available options:
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.