xAI TTS 1 Text to Speech API

xai/tts/v1

xAI TTS 1 Text to Speech turns scripts into multilingual audio with five voices and expressive speech tags. Place pauses and laughter within a line, or wrap a passage in tags to guide whispers and slower delivery.

Input
232/15000
Output Format
Output
Speech ready
$0.012 / 1K chars · characters × 2.4 / 1000 credits · 0.5568 credits

Examples

A kitchen sound experiment.mp3

轻轻敲一下空玻璃杯,再往杯里加一点水,声音为什么变低了?[pause] 敲击让杯壁振动,水也跟着运动。<slow>一起振动的质量增加,振动频率就降低了。</slow> 厨房里,也藏着一间小小的声学实验室。

Repair it together.mp3

Este sábado abrimos el taller de reparación del barrio a las diez. [pause] Trae esa silla que cojea o una mochila con la cremallera rota. Compartiremos herramientas y aprenderemos a repararlas juntos. Nos vemos en la biblioteca.

xAI TTS 1 Text to Speech

xAI TTS 1 Text to Speech is xAI’s speech generation model for multilingual narration and character lines. Inline tags guide pauses, laughter and sighs, while wrapping tags direct whispers or slower delivery across a passage. Choose a voice, language, codec and sample rate to prepare audio for video editing, course production or integration with audio systems.

Why Choose xAI TTS 1

  • Direct expression within the scriptUse inline tags for pauses, laughter or sighs and wrapping tags for whispered or slower passages, keeping delivery directions beside the relevant words.

  • Choose character voices from five presetsCompare eve, ara, rex, sal and leo with the same lines, choose a voice for a narrator or character, and use that preset for subsequent passages.

  • Prepare speech for multilingual contentDetect the language from the script or select a language and regional code to voice localized lessons, product explanations and stories.

  • Prepare audio for editing and integrationUse MP3 for playback, WAV for editing, or PCM, mulaw and alaw for audio systems, then set the sample rate and MP3 bitrate to match the destination.

Speech parameters

ParameterRequirementWhat it controls
textRequired

Text to speak, from 1 to 15,000 characters after trimming leading and trailing whitespace. Use [laugh], [pause], [sigh], <whisper>text</whisper>, or <slow>text</slow> to direct delivery.

voiceOptional

Choose eve, ara, rex, sal, or leo for your narrator or character. Default: eve.

Defaulteveararexsalleo
language_codeOptional

Choose a listed BCP-47 language code, or auto for automatic language detection.

Defaultautoenar-EGar-SAar-AEbnzhfrdehiiditjakopt-BRpt-PTrues-MXes-EStrvi
output_formatOptional

An object containing codec, sample_rate, and the MP3 bit_rate setting.

output_format.codecOptional

Audio encoding: mp3, wav, pcm, mulaw, or alaw. Default: mp3.

Defaultmp3wavpcmmulawalaw
output_format.sample_rateOptional

Sample rate in Hz: 8000, 16000, 22050, 24000, 44100, or 48000. Default: 24000.

Default24000800016000220504410048000
output_format.bit_rateOptional

MP3 bitrate in bits per second: 32000, 64000, 96000, 128000, 192000, or null. MP3 default: 128000. For wav, pcm, mulaw, and alaw, omit bit_rate or set it to null.

Default128000 (mp3)320006400096000128000192000null

Create your first voiceover

  1. Prepare the spoken scriptEnter the script in Text, add [pause] or [laugh] where needed, and use paired tags around whispered or slower passages.

  2. Choose a voice and languageChoose a voice in Voice and a language code or auto in Language Code. Start with a short passage to review the delivery.

  3. Set output and submitChoose Output Format.Codec and Output Format.Sample Rate. For mp3, set Output Format.Bit Rate, review the estimate and select Run.

  4. Review and save the audioPreview MP3 and WAV in the output panel. Download any format, including PCM, mulaw and alaw for use in an audio application.

Character-based pricing

xAI TTS 1 Text to Speech costs $0.012, or 2.4 credits, per 1,000 characters. Usage is proportional to the Unicode character count after trimming leading and trailing whitespace. Speech tags, punctuation, and spaces within the text count toward usage.

Text lengthCostCalculation
1 characters$0.000012 · 0.0024 credits1 × 2.4 / 1000 = 0.0024 credits
1,000 characters$0.012 · 2.4 credits1000 × 2.4 / 1000 = 2.4 credits
15,000 characters$0.18 · 36 credits15000 × 2.4 / 1000 = 36 credits

Put speech to work

  • Story narrationMark pauses at narrative turns and use whispered passages for quiet lines in short films and spoken stories.

  • Character linesChoose voices for characters and generate lines with laughter, sighs or changes in pace, then assemble them during editing.

  • Localized coursesChoose a language for translated lesson scripts and use the selected voice to produce terminology explanations and instructional audio.

Shape the delivery

  • Place [pause] at sentence boundaries and [laugh] or [sigh] where a line calls for that expression.
  • Use complete pairs such as <whisper>words</whisper> or <slow>words</slow> around the passage you want to direct.
  • Compare the five voices with the same short passage, then keep the chosen voice and language for the full narration.
  • Split long scripts at paragraph boundaries, keep each request within 15,000 characters and retain the same codec and sample rate for editing.

Choose output settings

  • The default output is MP3 at 24000 Hz and 128000 bit/s.
  • For wav, pcm, mulaw, or alaw requests, provide codec and sample_rate; omit bit_rate or set it to null.

xAI TTS 1 Text to Speech API frequently asked questions

What is the xAI TTS 1 Text to Speech API?

xAI TTS 1 Text to Speech is an xAI model that turns scripts into narration and character lines. It offers five voices, multilingual speech and expressive text tags for stories and lessons. Inline tags direct local pauses and vocal expressions, while wrapping tags guide whispers or slower delivery across a passage. You can call it programmatically or try it in the Playground tab.

Which voices can I choose in xAI TTS 1?

Voice offers eve, ara, rex, sal and leo, with eve as the default. Compare them using the same lines before choosing a voice for narration or a character.

How do inline speech tags work in xAI TTS 1?

Add [pause], [laugh] or [sigh] in Text where you want a pause, laugh or sigh. Keep tags next to the relevant words so you can review and refine delivery line by line.

How do wrapping tags work in xAI TTS 1?

Use <whisper>words</whisper> to guide whispers and <slow>words</slow> for slower delivery. Paired tags enclose the text you want to direct, allowing different passages within one script to use different delivery styles.

How do I choose a language in xAI TTS 1?

Set Language Code to auto for automatic detection, or select a code such as zh, en or ja. Portuguese, Spanish and Arabic have regional options in the list; choose the code that matches the script.

How long can an xAI TTS 1 script be?

Each request accepts 1–15,000 Unicode characters after trimming leading and trailing whitespace. Tags, punctuation and internal spaces count toward the limit. Split longer work into passages using the same voice, language and output settings.

Which audio formats does xAI TTS 1 offer?

Output Format.Codec offers mp3, wav, pcm, mulaw and alaw. Preview MP3 and WAV on the page, or download PCM, mulaw and alaw for audio systems. Choose a sample rate from the options listed in Parameters.

How do I set the MP3 bitrate in xAI TTS 1?

For mp3, choose 32000, 64000, 96000, 128000 or 192000 in Output Format.Bit Rate, measured in bit/s; the default is 128000. With other codecs, omit bit_rate or set it to null and configure the codec and sample rate.