# xAI | Grok TTS | Text to Speech xAI Text-to-Speech converts text into natural, expressive speech. Supports 5 voices (eve, ara, rex, sal, leo), 20+ auto-detected languages, inline speech tags for pauses/laughter/whispers/emphasis, and multiple output formats (MP3, WAV, PCM, mu-law, A-law). Max 15000 characters per request. ## API Information - **Model Slug:** xai-grok-tts-text-to-speech - **Branded URL:** https://www.eachlabs.ai/xai/grok-tts/xai-grok-tts-text-to-speech - **Provider:** xAI - **Category:** Text to Voice - **Output Type:** audio - **Status:** active - **Version:** 0.0.1 - **Base Cost:** xAI TTS: $15 per 1M characters - **Estimated Processing Time:** 10 seconds - **Last Updated:** 2026-08-16 - **Interactive Demo:** https://www.eachlabs.ai/ai-models/xai-grok-tts-text-to-speech ## Pricing - **Charge Type:** dynamic - **Estimated Price (default example):** $0.001530 - **Pricing Details:** xAI TTS: $15 per 1M characters ### Pricing Rules | Condition | Pricing | | --- | --- | | Rule 1 | xAI TTS: $15 per 1M characters | ## Input Schema | Parameter | Type | Required | Default | Constraints | Description | |-----------|------|----------|---------|-------------|-------------| | text | string | Yes | - | - | Text to convert to speech. Maximum 15000 characters. Supports 20+ languages (auto-detected). Inline speech tags: [pause], [long-pause], [laugh], [chuckle], [giggle], [cry], [tsk], [tongue-click], [lip-smack], [breath], [inhale], [exhale], [sigh], [hum-tune]. Wrapping tags: , , , , , , , , , , , , . | | voice_id | string | No | eve | eve,ara,rex,sal,leo | Voice selection (case-insensitive). eve: energetic and upbeat, great for demos and announcements. ara: warm and friendly, ideal for conversational interfaces. rex: confident and clear, best for business and tutorials. sal: smooth and balanced, versatile for varied content. leo: authoritative and strong, perfect for instructional content. | | output_format | string | No | mp3 | mp3,wav,pcm,mulaw,alaw | Audio codec. mp3: general use, good compression (default). wav: lossless, for editing/post-production. pcm: raw 16-bit audio for processing pipelines. mulaw: G.711 mu-law for telephony. alaw: G.711 A-law for telephony. | | sample_rate | integer | No | 24000 | 8000,16000,22050,24000,44100,48000 | Audio sample rate in Hz. 8000: narrowband telephony. 16000: wideband speech. 22050: standard balanced. 24000: high quality (default). 44100: CD quality. 48000: studio-grade. | | bit_rate | integer | No | 128000 | 32000,64000,96000,128000,192000 | MP3 bit rate in bps (MP3 codec only, ignored for other codecs). 32000: low/smallest file. 64000: medium/speech. 96000: standard. 128000: high quality (default). 192000: maximum fidelity. | ## Example Request ```bash curl -X POST https://api.eachlabs.ai/v1/prediction/ \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "xai-grok-tts-text-to-speech", "input": { "text": "Hello! Welcome to xAI text to speech. This is a demonstration of natural, expressive speech synthesis." } }' ``` ## Output Schema Response returned by `GET /v1/prediction/{id}` when the job completes: ```json { "status": "success", "predictionID": "string", "output": "string (URL of generated audio)", "metrics": { "predict_time": "number (seconds)" } } ``` ## Polling ```bash curl https://api.eachlabs.ai/v1/prediction/{PREDICTION_ID} \ -H "Authorization: Bearer YOUR_API_KEY" ``` | Status | Meaning | |--------|---------| | `processing` | Still running — poll again | | `success` | Done — read `output` | | `error` | Failed — read `message` / `details` | ## Webhook (alternative to polling) Pass `"webhook_url": "https://your.host/path"` in the create request. Eachlabs POSTs this payload when the job ends: ```json { "exec_id": "prediction-uuid", "status": "succeeded", "output": "https://...", "error": "" } ``` `status` is `"succeeded"` or `"failed"`. `exec_id` equals the `predictionID` from create. Return 2xx within 30 seconds. ## Errors Error body: `{ "status": "error", "message": "...", "details": "..." }` | Code | Meaning | |------|---------| | `400` | Invalid input | | `401` | Missing / invalid `Authorization` bearer token | | `404` | Unknown model or prediction id | | `429` | Rate limit — 100 creates / min, 10 concurrent per key | | `5xx` | Retry with backoff | ## Overview **xAI | Grok TTS | Text to Speech Overview** xAI | Grok TTS | Text to Speech converts written text into natural, expressive speech with fine-grained control over delivery and tone. Developed by xAI, the company behind the Grok AI model family, this text-to-voice solution addresses the need for high-quality audio generation across content creation, accessibility, and developer applications. The model distinguishes itself through support for inline speech tags that enable precise control over pauses, laughter, whispers, and emphasis—capabilities that go beyond standard text-to-speech offerings. With 5 distinct voices and automatic language detection across 20+ languages, xAI | Grok TTS | Text to Speech provides flexibility for global audiences while maintaining consistent audio quality. ## Usage Notes - API Base URL: `https://api.eachlabs.ai/v1` - Authentication: send `Authorization: Bearer YOUR_API_KEY`. Generate a key from the Eachlabs dashboard at https://www.eachlabs.ai/dashboard/api-keys. - File-typed parameters (`*_url`, `image_url`, `video_url`, `audio_url`, etc.) accept publicly-reachable HTTPS URLs only. Upload your asset first (GCS / S3 / your CDN) and pass the resulting URL. Data-URIs and localhost URLs are rejected. - For structured parameters (arrays / objects) send real JSON values, not stringified payloads. - Monetary values are reported in USD; per-token / per-megapixel rates may be billed in micro-cents internally. - Prefer `webhook_url` over polling for long-running predictions — see the Webhook Callback section.