Atualizado
What is the Grok Speech to Text API?
The Grok Speech to Text API is live on UnificAlly as xai/grok-stt, from $0.05 per hour of audio. Grok Speech to Text is xAI's transcription model, available on UnificAlly as xai/grok-stt on the same key and balance as the Grok language, voice, and Grok Imagine models. Give it the URL of an audio file and it returns the transcript, the detected language, the duration, and per-word start and end times, with speaker labels on request.
It takes the common audio and container formats, including mp4, m4a, and mkv, so recordings, podcasts, and video soundtracks all go through without conversion. Billing is per started hour of audio.
Grok Speech to Text API specs
| Model ID | xai/grok-stt |
| Endpoint | POST https://api.unifically.com/v1/tasks |
| Request types | Audio transcription from a public URL, with optional speaker diarization |
| Input formats | mp3, wav, ogg, opus, flac, aac, mp4, m4a, mkv |
| Output | JSON with text, language, duration in seconds, and a words array with per-word start and end times |
| Language | Detected automatically, or set a code hint such as en, fr, or de |
| Reference inputs | One audio file, passed as audio_url |
| Rate | $0.05/hour, per started hour of audio |
Billing is per started hour of audio, with no subscription. The pricing page shows the live rate.
How to use the Grok Speech to Text API
- Create an API key on the API keys page.
- Send a POST request to
/v1/taskswith the model ID and aninputobject holding theaudio_url. - Read the
task_idfrom 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-stt",
"input": {
"audio_url": "https://files.unifically.com/your-interview.mp3",
"diarize": true
}
}'
The response returns the task ID straight away:
{
"code": 200,
"success": true,
"data": {
"task_id": "abc123def456",
"status": "processing"
}
}
Poll the task, or set a callback_url on the request.
curl https://api.unifically.com/v1/tasks/{task_id} -H "Authorization: Bearer YOUR_API_KEY"
When status is completed, the task carries the transcript in output:
{
"code": 200,
"success": true,
"data": {
"task_id": "abc123def456",
"status": "completed",
"output": {
"text": "Thanks for joining us today. Let's get started.",
"language": "en",
"duration": 4.8,
"words": [
{ "word": "Thanks", "start": 0.0, "end": 0.42 },
{ "word": "for", "start": 0.42, "end": 0.55 }
]
}
}
}
Grok Speech to Text API parameters
| Parameter | Type | Default | What it does |
|---|---|---|---|
audio_url | string | none | Required. Public URL of the audio file to transcribe. Supported formats are mp3, wav, ogg, opus, flac, aac, mp4, m4a, and mkv |
language | string | none | Language code hint, for example en, fr, or de. Omit it to auto-detect |
diarize | boolean | false | Labels each word with the detected speaker |
The audio_url must be publicly reachable. A URL that cannot be fetched is rejected with a 422 before the task starts. The Grok Speech to Text API documentation has the full reference.
Key features of Grok Speech to Text
Word-level timestamps
Every word comes back with start and end times in seconds, ready for captions, search highlighting, and clip extraction.
Speaker diarization
Set diarize to true and each word carries a speaker label, which turns an interview or call recording into a turn-by-turn transcript.
Language detection and hints
The model detects the language and reports it. Pass a code such as en or de as a hint for short or mixed recordings.
Nine input formats by URL
mp3, wav, ogg, opus, flac, aac, mp4, m4a, and mkv. Point at a public URL, or upload a file in the playground and it is hosted for you.
Checked before it is billed
An unreachable URL is rejected up front, and billing is per started hour of audio, so the cost of a file is known from its length.
What Grok Speech to Text is best for
Interviews and calls
Diarized transcripts with timing for meetings, podcasts, and customer calls.
Captions and subtitles
Word timestamps map straight onto caption cues for video, including clips you generated with Grok Imagine.
Searchable audio archives
Transcribe a back catalog once and search or quote it by timestamp afterwards.
Multilingual recordings
Automatic language detection handles mixed sources without per-file configuration.
Grok Speech to Text limitations
Input is by URL only and must be publicly reachable; there is no streaming or real-time mode on this route. Diarization labels speakers but does not name them, and there are no word-boost lists, entity detection, or formatting controls. Billing rounds up to the next hour, so many very short files cost more than one long one of the same total length.
Perguntas frequentes
Perguntas frequentes sobre Grok Speech to Text
It is xAI's Grok transcription model served through UnificAlly as xai/grok-stt. Send the public URL of an audio file and the task returns the transcript text, the detected language, the audio duration, and per-word timing, with optional speaker labels.
Transcription requests use a key from the API keys page, sent as Authorization: Bearer <key> to https://api.unifically.com/v1/tasks with model xai/grok-stt. All the first job needs is a public audio_url in mp3, wav, ogg, opus, flac, aac, mp4, m4a or mkv.
Give input.audio_url, and optionally language (omit it to auto-detect) and diarize: true to label speakers, under model xai/grok-stt. When the task reaches completed, its output holds the transcript in text plus language, duration and per-word timings in words.
mp3, wav, ogg, opus, flac, aac, mp4, m4a, and mkv, given as a publicly reachable URL. A URL that cannot be fetched is rejected before the task starts, so nothing is charged.
Yes. Omit language and the model detects it and reports the code in the result. Pass a code such as en, fr, or de as a hint when the audio is short or mixed.
Set diarize to true and every word in the result carries the label of the speaker who said it, so you can rebuild a turn-by-turn transcript of an interview or a call.
Per started hour of audio, at $0.05/hour. A 5-minute file and a 59-minute file cost the same; a 61-minute file counts as two hours. For many short files the cost is the per-hour rate times the number of files, so batch short clips where you can.
A JSON object with text, language, duration in seconds, and a words array of { word, start, end } entries, each with a speaker label when diarization is on.