Pular para o conteúdo principal
Model logo

API do Grok Text to Speech

  • Texto para fala

Grok Text to Speech faz parte da família de modelos GrokVer todos os modelos Grok

Saída

Seu audio gerado aparecerá aqui

Atualizado

What is the Grok Text to Speech API?

The Grok Text to Speech API is live on UnificAlly as xai/grok-tts, from $0.0075 per 1,000 characters of text.

Grok Text to Speech is xAI's voice model, available on UnificAlly as xai/grok-tts alongside the Grok language and Grok Imagine models on the same key and balance. Send text and a voice ID, and the API returns a hosted audio file in mp3, wav, or raw pcm.

It covers twenty languages with automatic detection, a speed range of 0.7 to 1.5, and a catalog of preset voices with distinct styles, from warm assistant voices to dramatic narration. Billing is per character, so the cost of any request is known before it runs.

Grok Text to Speech API specs

Model IDxai/grok-tts
EndpointPOST https://api.unifically.com/v1/tasks
Request typesText to speech
Text lengthUp to 60,000 characters per request
VoicesGrok preset voices by ID, ara by default
LanguageDetected from the text, or set with a BCP-47 code
Speed0.7 to 1.5, where 1.0 is normal
Output formatsmp3, wav, pcm
Reference inputsNone. The request takes text only
Rate$0.0075/1000 characters

Billing is per character of the text you send, with no subscription. The pricing page shows the live rate.

How to use the Grok Text to Speech API

  1. Create an API key on the API keys page.
  2. Send a POST request to /v1/tasks with the model ID and an input object that holds the text.
  3. Read the task_id from the response, then check the task until it is finished, or pass a callback URL and wait for the result.
curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "xai/grok-tts",
    "input": {
      "text": "Welcome back. Your order has shipped and should arrive on Thursday.",
      "voice_id": "ara",
      "language": "en",
      "speed": 1.0,
      "format": "mp3"
    }
  }'

The response returns the task ID straight away:

{
  "code": 200,
  "success": true,
  "data": {
    "task_id": "abc123def456",
    "status": "processing"
  }
}

Poll the task until status is completed, or set a callback_url on the request.

curl https://api.unifically.com/v1/tasks/{task_id} \
  -H "Authorization: Bearer YOUR_API_KEY"

The completed task carries the audio url in the requested format and the number of characters billed:

{
  "code": 200,
  "success": true,
  "data": {
    "task_id": "abc123def456",
    "status": "completed",
    "output": {
      "url": "https://files.unifically.com/audio/tts_abc123def456.mp3",
      "characters": 68
    }
  }
}

Grok Text to Speech API parameters

ParameterTypeDefaultWhat it does
textstringnoneRequired. The text to convert to speech, up to 60,000 characters per request
voice_idstringaraPreset voice ID
languagestringautoBCP-47 language code such as en, es, or pt-BR, or auto to detect it from the text
speednumber1.0Speech speed multiplier, 0.7 to 1.5. 1.0 is normal
formatstringmp3Audio format: mp3, wav, or pcm

The Grok Text to Speech API documentation has the full reference.

Key features of Grok Text to Speech

Preset voices with character

Each Grok voice comes with a style, from warm and friendly to authoritative or dramatic. Pick by ID; ara is the default. The same IDs work for spoken lines in Grok Imagine 1.5 Video.

Twenty languages, auto-detected

Leave language on auto and the model reads the text in its own language, or pin one with a BCP-47 code such as pt-BR when the text is ambiguous.

Speed from 0.7 to 1.5

Slow a voice down for accessibility and learning content or speed it up for notifications and summaries, without changing pitch or voice.

mp3, wav, or pcm

mp3 for delivery, wav for editing, raw pcm for pipelines that stream or post-process audio themselves.

Up to 60,000 characters per request

Long articles and scripts go through in one call. The response reports the number of characters billed.

What Grok Text to Speech is best for

  • Voiceovers for generated video

    Narrate Grok Imagine or any other clip with a consistent voice, then mix the file in your editor.

  • Product and support voices

    Order updates, confirmations, and IVR prompts in a warm assistant voice, in the language of the message.

  • Articles and newsletters as audio

    Turn long text into listenable audio in one request, with per-character pricing that scales with length.

  • Multilingual content

    One request per language with the same voice ID keeps a brand voice consistent across markets.

Grok Text to Speech limitations

Voices are preset: there is no voice cloning or custom voice upload on this route. Speed runs from 0.7 to 1.5 only, and there are no fine-grained prosody or emotion controls beyond punctuation and phrasing in the text. Streaming playback is not part of the task API; the result is a complete file URL once the task finishes.

Perguntas frequentes

Perguntas frequentes sobre Grok Text to Speech

It is xAI's Grok voice model served through UnificAlly as xai/grok-tts. Send text, pick a preset voice, and get back an audio file. Language is detected automatically or set with a BCP-47 code, speed runs from 0.7 to 1.5, and the output is mp3, wav, or raw pcm.

Speech jobs on xai/grok-tts authenticate with a key from the API keys page, passed as a Bearer token to https://api.unifically.com/v1/tasks. The first request needs only text, up to 60,000 characters; the voice defaults to ara and the format to mp3.

Post an input with text and optionally voice_id, language, speed (0.7 to 1.5) and format (mp3, wav or pcm) under model xai/grok-tts. Once the task is completed, output.url links the audio file and output.characters shows the characters billed.

A catalog of Grok preset voices, each with a short style description; ara is the default. The playground lists them, and the same voice IDs work in the video routes that accept preset voices.

Twenty, including English, Spanish, Portuguese, French, German, Italian, Japanese, Korean, and Chinese. Leave language on auto to detect it from the text, or pass a code such as en, es, or pt-BR to force one.

Per character of the text you submit, at $0.0075/1000 characters, so the cost of a request is known before it runs. The playground shows the price for your text before you generate.

Up to 60,000 characters per request. For a long script, split on paragraph boundaries and join the files, or send one request per section.

mp3 by default, or wav and raw pcm on request through the format field. The result is a hosted file URL plus the character count that was billed.