xAI Text-to-Speech

xAI Text-to-Speech converts text into natural-sounding spoken audio with a single API call. It offers more than two dozen expressive voices, inline speech tags for fine-grained control over pauses, laughter, whispers, and emphasis, and supports over 20 auto-detected languages.

Complete technical specification for integration
Ready-to-use code snippets for common workflows
text-to-audio
Antarctic Research Station PA Announcement$0.00583~5sAttention, winter-over team. Katabatic winds are now exceeding seventy knots, and visibility beyond the eastern marker is near zero. Exterior travel is suspended until further notice. Please secure all loose equipment, confirm your radio check, and report to the central module by nineteen hundred hours. The storm may sound close tonight, but this station was built for it—and so were we.
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
model: 'xai:tts@0',
speech: {
text: 'Attention, winter-over team. Katabatic winds are now exceeding seventy knots, and visibility beyond the eastern marker is near zero. Exterior travel is suspended until further notice. Please secure all loose equipment, confirm your radio check, and report to the central module by nineteen hundred hours. The storm may sound close tonight, but this station was built for it—and so were we.',
voice: 'orion',
language: 'en'
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "xai:tts@0",
"speech": {
"text": "Attention, winter-over team. Katabatic winds are now exceeding seventy knots, and visibility beyond the eastern marker is near zero. Exterior travel is suspended until further notice. Please secure all loose equipment, confirm your radio check, and report to the central module by nineteen hundred hours. The storm may sound close tonight, but this station was built for it—and so were we.",
"voice": "orion",
"language": "en"
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "audioInference",
"taskUUID": "d0a168d4-b925-4414-8b9c-d2946d0460fe",
"model": "xai:tts@0",
"speech": {
"text": "Attention, winter-over team. Katabatic winds are now exceeding seventy knots, and visibility beyond the eastern marker is near zero. Exterior travel is suspended until further notice. Please secure all loose equipment, confirm your radio check, and report to the central module by nineteen hundred hours. The storm may sound close tonight, but this station was built for it—and so were we.",
"voice": "orion",
"language": "en"
}
}
]'runware run xai:tts@0 \
speech.text="Attention, winter-over team. Katabatic winds are now exceeding seventy knots, and visibility beyond the eastern marker is near zero. Exterior travel is suspended until further notice. Please secure all loose equipment, confirm your radio check, and report to the central module by nineteen hundred hours. The storm may sound close tonight, but this station was built for it—and so were we." \
speech.voice=orion \
speech.language=en{
"taskType": "audioInference",
"taskUUID": "d0a168d4-b925-4414-8b9c-d2946d0460fe",
"model": "xai:tts@0",
"speech": {
"text": "Attention, winter-over team. Katabatic winds are now exceeding seventy knots, and visibility beyond the eastern marker is near zero. Exterior travel is suspended until further notice. Please secure all loose equipment, confirm your radio check, and report to the central module by nineteen hundred hours. The storm may sound close tonight, but this station was built for it—and so were we.",
"voice": "orion",
"language": "en"
}
}Response
{
"taskType": "audioInference",
"taskUUID": "d0a168d4-b925-4414-8b9c-d2946d0460fe",
"audioUUID": "0a3b0434-192e-4745-8ec9-4de77b731c6c",
"audioURL": "https://am.runware.ai/audio/os/a02d21/ws/5/ai/0a3b0434-192e-4745-8ec9-4de77b731c6c.mp3",
"cost": 0.005835
}text-to-audio
Forensic Arboriculture Podcast Intro$0.00612~5sA fallen branch can look like bad luck. To a forensic arborist, it is testimony. The split wood, the hidden decay, even the direction of the wind can reveal what happened—and whether it could have been prevented. Welcome to Rings of Evidence, the podcast where urban trees become witnesses. In this episode, we examine a century-old plane tree, a crowded pavement, and the warning signs everyone walked past.
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
model: 'xai:tts@0',
speech: {
text: 'A fallen branch can look like bad luck. To a forensic arborist, it is testimony. The split wood, the hidden decay, even the direction of the wind can reveal what happened—and whether it could have been prevented. Welcome to Rings of Evidence, the podcast where urban trees become witnesses. In this episode, we examine a century-old plane tree, a crowded pavement, and the warning signs everyone walked past.',
voice: 'orion',
language: 'en'
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "xai:tts@0",
"speech": {
"text": "A fallen branch can look like bad luck. To a forensic arborist, it is testimony. The split wood, the hidden decay, even the direction of the wind can reveal what happened—and whether it could have been prevented. Welcome to Rings of Evidence, the podcast where urban trees become witnesses. In this episode, we examine a century-old plane tree, a crowded pavement, and the warning signs everyone walked past.",
"voice": "orion",
"language": "en"
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "audioInference",
"taskUUID": "ae938bee-4c14-4a31-b768-b26e7eba27a5",
"model": "xai:tts@0",
"speech": {
"text": "A fallen branch can look like bad luck. To a forensic arborist, it is testimony. The split wood, the hidden decay, even the direction of the wind can reveal what happened—and whether it could have been prevented. Welcome to Rings of Evidence, the podcast where urban trees become witnesses. In this episode, we examine a century-old plane tree, a crowded pavement, and the warning signs everyone walked past.",
"voice": "orion",
"language": "en"
}
}
]'runware run xai:tts@0 \
speech.text="A fallen branch can look like bad luck. To a forensic arborist, it is testimony. The split wood, the hidden decay, even the direction of the wind can reveal what happened—and whether it could have been prevented. Welcome to Rings of Evidence, the podcast where urban trees become witnesses. In this episode, we examine a century-old plane tree, a crowded pavement, and the warning signs everyone walked past." \
speech.voice=orion \
speech.language=en{
"taskType": "audioInference",
"taskUUID": "ae938bee-4c14-4a31-b768-b26e7eba27a5",
"model": "xai:tts@0",
"speech": {
"text": "A fallen branch can look like bad luck. To a forensic arborist, it is testimony. The split wood, the hidden decay, even the direction of the wind can reveal what happened—and whether it could have been prevented. Welcome to Rings of Evidence, the podcast where urban trees become witnesses. In this episode, we examine a century-old plane tree, a crowded pavement, and the warning signs everyone walked past.",
"voice": "orion",
"language": "en"
}
}Response
{
"taskType": "audioInference",
"taskUUID": "ae938bee-4c14-4a31-b768-b26e7eba27a5",
"audioUUID": "aaedf546-8dd7-49cf-b5a3-16f39469eb75",
"audioURL": "https://am.runware.ai/audio/os/a06dlim3/ws/5/ai/aaedf546-8dd7-49cf-b5a3-16f39469eb75.mp3",
"cost": 0.00612
}text-to-audio
Grid Resilience Podcast Cold Open$0.00612~5sThe storm began ninety-three million miles away. By sunrise, charged particles were pressing against Earth’s magnetic field—and grid operators were watching the needles move. Welcome to The Long Circuit, the podcast about the hidden systems that keep modern life running. Today: how a burst of solar plasma becomes a problem for transformers, satellites, and the people responsible for keeping the lights on.
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
model: 'xai:tts@0',
speech: {
text: 'The storm began ninety-three million miles away. By sunrise, charged particles were pressing against Earth’s magnetic field—and grid operators were watching the needles move. Welcome to The Long Circuit, the podcast about the hidden systems that keep modern life running. Today: how a burst of solar plasma becomes a problem for transformers, satellites, and the people responsible for keeping the lights on.',
voice: 'orion',
language: 'en'
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "xai:tts@0",
"speech": {
"text": "The storm began ninety-three million miles away. By sunrise, charged particles were pressing against Earth’s magnetic field—and grid operators were watching the needles move. Welcome to The Long Circuit, the podcast about the hidden systems that keep modern life running. Today: how a burst of solar plasma becomes a problem for transformers, satellites, and the people responsible for keeping the lights on.",
"voice": "orion",
"language": "en"
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "audioInference",
"taskUUID": "4f13fed5-2310-4c44-8d41-0a61cb97efd7",
"model": "xai:tts@0",
"speech": {
"text": "The storm began ninety-three million miles away. By sunrise, charged particles were pressing against Earth’s magnetic field—and grid operators were watching the needles move. Welcome to The Long Circuit, the podcast about the hidden systems that keep modern life running. Today: how a burst of solar plasma becomes a problem for transformers, satellites, and the people responsible for keeping the lights on.",
"voice": "orion",
"language": "en"
}
}
]'runware run xai:tts@0 \
speech.text="The storm began ninety-three million miles away. By sunrise, charged particles were pressing against Earth’s magnetic field—and grid operators were watching the needles move. Welcome to The Long Circuit, the podcast about the hidden systems that keep modern life running. Today: how a burst of solar plasma becomes a problem for transformers, satellites, and the people responsible for keeping the lights on." \
speech.voice=orion \
speech.language=en{
"taskType": "audioInference",
"taskUUID": "4f13fed5-2310-4c44-8d41-0a61cb97efd7",
"model": "xai:tts@0",
"speech": {
"text": "The storm began ninety-three million miles away. By sunrise, charged particles were pressing against Earth’s magnetic field—and grid operators were watching the needles move. Welcome to The Long Circuit, the podcast about the hidden systems that keep modern life running. Today: how a burst of solar plasma becomes a problem for transformers, satellites, and the people responsible for keeping the lights on.",
"voice": "orion",
"language": "en"
}
}Response
{
"taskType": "audioInference",
"taskUUID": "4f13fed5-2310-4c44-8d41-0a61cb97efd7",
"audioUUID": "02333a55-18e6-4efe-8915-04df005c2d4e",
"audioURL": "https://am.runware.ai/audio/os/a10dlim3/ws/5/ai/02333a55-18e6-4efe-8915-04df005c2d4e.mp3",
"cost": 0.00612
}text-to-audio
Restaurant Oyster Shell Recycling Explainer$0.00791~6sTonight’s oysters can help protect tomorrow’s shoreline. Instead of sending empty shells to a landfill, your restaurant can return them to the coast—where they become the foundation for new oyster reefs. Here’s how it works: collect the shells, schedule a pickup, and the local recovery team handles the rest. The restored reefs create habitat, filter coastal waters, and soften the impact of waves. One small change in your kitchen can make a lasting difference beyond it. Join your community’s oyster shell recycling program.
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
model: 'xai:tts@0',
speech: {
text: 'Tonight’s oysters can help protect tomorrow’s shoreline. Instead of sending empty shells to a landfill, your restaurant can return them to the coast—where they become the foundation for new oyster reefs. Here’s how it works: collect the shells, schedule a pickup, and the local recovery team handles the rest. The restored reefs create habitat, filter coastal waters, and soften the impact of waves. One small change in your kitchen can make a lasting difference beyond it. Join your community’s oyster shell recycling program.',
voice: 'orion',
language: 'en'
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "xai:tts@0",
"speech": {
"text": "Tonight’s oysters can help protect tomorrow’s shoreline. Instead of sending empty shells to a landfill, your restaurant can return them to the coast—where they become the foundation for new oyster reefs. Here’s how it works: collect the shells, schedule a pickup, and the local recovery team handles the rest. The restored reefs create habitat, filter coastal waters, and soften the impact of waves. One small change in your kitchen can make a lasting difference beyond it. Join your community’s oyster shell recycling program.",
"voice": "orion",
"language": "en"
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "audioInference",
"taskUUID": "3717e9dd-326c-4e8b-874f-136a155bfc51",
"model": "xai:tts@0",
"speech": {
"text": "Tonight’s oysters can help protect tomorrow’s shoreline. Instead of sending empty shells to a landfill, your restaurant can return them to the coast—where they become the foundation for new oyster reefs. Here’s how it works: collect the shells, schedule a pickup, and the local recovery team handles the rest. The restored reefs create habitat, filter coastal waters, and soften the impact of waves. One small change in your kitchen can make a lasting difference beyond it. Join your community’s oyster shell recycling program.",
"voice": "orion",
"language": "en"
}
}
]'runware run xai:tts@0 \
speech.text="Tonight’s oysters can help protect tomorrow’s shoreline. Instead of sending empty shells to a landfill, your restaurant can return them to the coast—where they become the foundation for new oyster reefs. Here’s how it works: collect the shells, schedule a pickup, and the local recovery team handles the rest. The restored reefs create habitat, filter coastal waters, and soften the impact of waves. One small change in your kitchen can make a lasting difference beyond it. Join your community’s oyster shell recycling program." \
speech.voice=orion \
speech.language=en{
"taskType": "audioInference",
"taskUUID": "3717e9dd-326c-4e8b-874f-136a155bfc51",
"model": "xai:tts@0",
"speech": {
"text": "Tonight’s oysters can help protect tomorrow’s shoreline. Instead of sending empty shells to a landfill, your restaurant can return them to the coast—where they become the foundation for new oyster reefs. Here’s how it works: collect the shells, schedule a pickup, and the local recovery team handles the rest. The restored reefs create habitat, filter coastal waters, and soften the impact of waves. One small change in your kitchen can make a lasting difference beyond it. Join your community’s oyster shell recycling program.",
"voice": "orion",
"language": "en"
}
}Response
{
"taskType": "audioInference",
"taskUUID": "3717e9dd-326c-4e8b-874f-136a155bfc51",
"audioUUID": "b04e1bdc-558e-4bec-b92f-e490c6cf33fc",
"audioURL": "https://am.runware.ai/audio/os/a04d20/ws/5/ai/b04e1bdc-558e-4bec-b92f-e490c6cf33fc.mp3",
"cost": 0.007905
}