Learning resourcesReviewed · xAI

xAI Speech to Text API documentation (grok-voice-transcribe-2.0)

This xAI documentation page is for developers who want to turn recorded or live audio into text in their applications. Its main catch is that the page gives no pricing, accuracy figures, rate-limit numbers or terms of use. The page documents a REST endpoint (POST [https://api.x.ai/v1/stt]) and a WebSocket streaming endpoint ([wss://api.x.ai/v1/stt]) that both use a single model, grok-voice-transcribe-2.0. Features include word timestamps, speaker diarization, multichannel audio, text formatting and Smart Turn end-of-speech detection.

Researched 15 Nov 2026

In short.

This xAI documentation page is for developers who want to turn recorded or live audio into text in their applications. Its main catch is that the page gives no pricing, accuracy figures, rate-limit numbers or terms of use. Technically, the page describes two endpoints. The REST endpoint ([https://api.x.ai/v1/stt]) takes either an uploaded file, which can be up to 500 MB, or a URL that the server downloads. The page gives no size limit for audio fetched from a URL. The REST endpoint accepts the 15 audio formats the page lists: 12 auto-detected container formats and 3 raw formats (PCM, mu-law and A-law). The WebSocket endpoint ([wss://api.x.ai/v1/stt]) handles real-time streaming of raw PCM, mu-law or A-law audio, or individual Opus packets. Container files cannot be streamed directly, and the page sends them to the batch endpoint instead. Both endpoints use the model grok-voice-transcribe-2.0 and authenticate with an XAI_API_KEY bearer token. Options include word-level timestamps, speaker diarization, separate transcription of up to 8 audio channels, key-term biasing, filler-word control and inverse text normalisation (for example 'one hundred dollars' becomes '$100'). Streaming also offers interim results and a Smart Turn end-of-turn detector. Nothing was run, so every behaviour described here is as documented by the vendor and not verified.

Researched and written by an AI model and checked by a second AI model. How it works

This report covers only the selected documentation page at [https://docs.x.ai/developers/model-capabilities/audio/speech-to-text.md], captured in full on 15 November 2026. Pages the document links to are excluded and were not read: the Voice Overview, Text to Speech, the two API Reference sections, the live voice demos ([https://x.ai/api/voice]) and the xAI console ([https://console.x.ai/team/default/api-keys]). As a result, pricing, terms of use, privacy and retention policy, rate-limit values and any changelog are not assessed. The page's code samples and described behaviour were not executed and not tested against the live service.

The overview

What this resource is

The resource is a single documentation page titled 'Speech to Text' in the Model Capabilities, Audio section of xAI's developer docs, at [https://docs.x.ai/developers/model-capabilities/audio/speech-to-text.md]. It documents one hosted service: a transcription API at [https://api.x.ai/v1/stt] for batch (REST, multipart/form-data) use, and at [wss://api.x.ai/v1/stt] for real-time streaming over WebSocket.

The only model named is grok-voice-transcribe-2.0, described as 'our best transcription model' and the default when no model is given. The page does not say who trained it, its size, its architecture or its release date. The page's 'Related' list refers to 'SpaceXSI voice capabilities', a name the page does not explain.

The resource is the documentation, not the service itself and not a downloadable library. The page ships no installable package or SDK. Its samples use raw HTTP (curl, Python requests, JavaScript fetch) and the websockets and ws libraries.

Overall assessment

As documentation, the page is concrete and usable. It gives every request parameter with type, default and constraints, a response schema, a status-code table, the full WebSocket event model and complete code samples in curl, Python and JavaScript. A developer can write a first integration from it without leaving the page.

What it does not give is what a buyer or evaluator needs to decide. There is no price, free tier or quota, no accuracy or word-error-rate data for any language, and no measured end-to-end transcription latency benchmarks. There are also no numeric rate limits, no data-retention or privacy statement, and no terms of use. It describes capabilities as vendor claims, with no benchmarks or test results. Those gaps are unknowns, not negative findings.

The page also has small internal inconsistencies, listed under limitations. Check them against the API Reference before relying on exact strings.

Who it is for

The page targets developers who can make HTTP requests or open WebSocket connections and handle JSON. Beginners can follow the curl quick start. The streaming sections assume you know audio basics such as sample rate, PCM, mono and stereo channels, and chunking.

The page itself lists use cases: live captions for calls, meetings and streams; voice assistants; call-centre agent assistance with one channel per speaker; accessibility transcription; and voice commands. The batch endpoint suits recorded meetings, calls and media files.

It is not aimed at people who want a finished transcription app with an interface. Anyone who needs a self-hosted or offline model should note that this is a hosted API: audio is sent to xAI's servers, and the page says nothing about what happens to it afterwards.

What the API can do, per the page

Batch transcription takes one POST with either an uploaded file (maximum 500 MB) or a url the server downloads. The page states no size limit for audio downloaded from a url. The response has the full text, the detected language as a BCP-47 code, the duration in seconds, and a words array with start and end times. The API accepts 12 container formats (WAV, MP3, OGG, Opus, FLAC, AAC, MP4, M4A, MKV, WebM, AVI, MOV) and 3 raw formats (PCM signed 16-bit little-endian, G.711 mu-law, G.711 A-law). Together these make up the '15 audio formats' the page mentions.

Languages: the table lists 38 languages, and the page says '38+'. The model detects the language automatically and follows switches inside a recording. The optional language parameter biases results toward a language. Spanish, Portuguese and Arabic also accept regional codes (es-ES, pt-PT, ar-AE, ar-SA). The base codes es, pt and ar default to the Mexican, Brazilian and Egyptian variants.

Text formatting (format=true, inverse text normalisation) writes spoken numbers, currencies and units in written form. It works only for Arabic, Mandarin Chinese, English, French, German, Japanese, Portuguese, Russian, Spanish, Swedish and Vietnamese. It requires the language parameter, and the page says it has no effect in other languages.

Other options include speaker diarization, which adds an integer speaker field to each word. Multichannel transcription transcribes each channel independently. In REST responses, the per-channel results come in a channels array whose entries have index, text and words, and a channels count of 2 to 8 is only needed for raw audio. Key-term biasing accepts up to 100 terms, each up to 50 characters. A filler_words switch controls fillers such as 'uh' and 'um', which are removed by default, and a vad_threshold setting controls the voice-activity gate.

Streaming adds interim results about every 500 ms, an endpointing silence setting (0 to 5000 ms, default 400) and a finalize message for push-to-talk. It also accepts Opus packet input (mono only) to save bandwidth, and offers Smart Turn, a model that decides whether a pause is the end of the speaker's turn. Multichannel streaming takes interleaved audio with channels set to 2 or more (maximum 8). It returns no channels array. Instead, each transcript.partial event carries a 0-based channel_index, and after audio.done the server sends one transcript.done event per channel, each with its own channel_index.

Using it

Requirements

You need an xAI API key, sent as 'Authorization: Bearer $XAI_API_KEY'. The page links to the API-keys page of the xAI console ([https://console.x.ai/team/default/api-keys]) for getting one. The page does not say what account, plan or approval you need to obtain a key, so that is unknown.

REST requirements: you need an HTTP client that can send multipart/form-data with either a file (maximum 500 MB, sent as the last field) or a url. Container formats such as MP3 and WAV are auto-detected, and the page says not to set audio_format for them. Raw headerless audio needs audio_format (pcm, mulaw or alaw) and sample_rate (8000, 16000, 22050, 24000, 44100 or 48000 Hz). Multichannel raw audio also needs channels (2 to 8).

Streaming requirements: you need a WebSocket client that can send the Authorization header. The page's samples use Python with the websockets package or Node.js with the ws package. Streaming does not use audio_format. The encoding query parameter describes the audio instead: pcm, mulaw, alaw or opus, with pcm as the default. sample_rate defaults to 16000 Hz and is ignored when encoding=opus, because Opus packets do not carry a sample rate. channels defaults to 1 and can be at most 8. multichannel=true requires channels of 2 or more and is not supported with Opus. Opus input must be sent as exactly one raw packet per binary frame, not as a container file.

For streaming, run a backend that holds the key. The page warns never to expose the API key in client-side code and to proxy WebSocket connections through your own backend.

You need network access to xAI's API endpoints ([https://api.x.ai/v1/stt] and [wss://api.x.ai/v1/stt]). The page gives no information on regional availability, data residency or supported countries.

How it works

Batch mode is a request/response call. You POST the multipart form fields (model, language, format, keyterm and so on) together with the audio, and the service returns JSON. The page stresses that the file field must be the last field in the multipart body, because for streamable uploads fields sent after the file may be ignored.

Streaming mode opens a WebSocket whose settings are all in the URL query string, with no setup message. You wait for a transcript.created event, then send raw binary audio frames (no base64) paced in real time. The page's example uses 100 ms chunks, which is 3,200 bytes of 16 kHz mono PCM16. You then send {"type": "audio.done"} and wait for transcript.done. The page says the connection closes after that. In between, transcript.partial events carry text, words, start, duration and two flags. is_final=false with speech_final=false is an interim result that may change. is_final=true with speech_final=false is a locked chunk of about 3 seconds of speech. Both flags true means the speaker has finished an utterance.

In multichannel streaming (multichannel=true with channels of 2 or more), you send interleaved audio, such as L,R,L,R for stereo. The server de-interleaves it and transcribes each channel in parallel. transcript.created is sent once for the whole session. transcript.partial events from different channels arrive interleaved, and each carries a 0-based channel_index. After audio.done, the server sends one transcript.done per channel, each with its own channel_index. So the first transcript.done you receive does not mean every channel has finished, and a client should wait for one per channel. A finalize message without a channel field finalizes every channel, while {"type": "Finalize", "channel": N} finalizes only channel N.

Smart Turn is enabled by setting smart_turn to a value from 0.0 to 1.0. The service then evaluates the audio at each silence boundary. If its end-of-turn confidence is below your threshold, the event is downgraded to a chunk final, so a mid-sentence pause does not end the utterance. smart_turn_timeout (1 to 5000 ms) forces a final result after a maximum silence. The page quotes confidence values of 0.95+ for natural endings and about 0.005 for mid-sentence pauses, and gives no test method for these figures.

The page says voice-activity detection decides what gets transcribed. Segments scoring below vad_threshold are skipped. The default is 0.5 for REST and 0.08 for streaming. Lowering it helps with quiet or telephone audio but can produce spurious text from background noise.

Setup

Create an API key in the xAI console, store it in an environment variable named XAI_API_KEY, and send it as a bearer token. No xAI SDK is required; the Python REST example uses requests, while the curl example requires curl. The JavaScript REST example uses fetch, FormData and Blob with the fs module. For the streaming samples, install websockets (Python) or ws (Node.js).

For batch use, send one POST to [https://api.x.ai/v1/stt] with the model field, the optional language and format fields, and the file as the last field. For raw headerless audio, add audio_format and sample_rate. Leave audio_format unset for container formats such as MP3 or WAV. Check for HTTP 200 and read the text, duration and words fields.

For live use, build a WebSocket URL such as [wss://api.x.ai/v1/stt?model=grok-voice-transcribe-2.0&sample_rate=16000&encoding=pcm&interim_results=true]. The page recommends 16 kHz PCM because it is the model's native rate, which avoids server-side resampling. It also recommends interim_results for responsive interfaces, format=true together with language for numbers, and encoding=opus on bandwidth-limited clients (about 4 KB/s versus 48 KB/s for PCM at 24 kHz). With Opus, omit sample_rate and send one packet per frame.

The Python and JavaScript streaming samples assume specific input. Both skip exactly the first 44 bytes of the file and send the rest as mono, 16 kHz, 16-bit PCM. The URL sets sample_rate=16000 and encoding=pcm, channels stays at its default of 1, and each 100 ms chunk is 3,200 bytes. The samples neither parse the WAV header nor convert the audio, so the file must already contain mono 16 kHz PCM16 data after exactly 44 header bytes. A header of standard length does not by itself mean the audio inside is in that format. Whether the samples work with other WAV files is unverified, and the page does not discuss this.

Example from the page

The quick-start call is curl -X POST [https://api.x.ai/v1/stt] with the header 'Authorization: Bearer $XAI_API_KEY'. Its form fields are model=grok-voice-transcribe-2.0, format=true, language=en and keyterm="Understand The Universe", with file=@audio.mp3 as the last field. The page shows the same call in Python (requests) and JavaScript (fetch with FormData).

The documented response is JSON with text 'The balance is $167,983.15.', language 'en', duration 3.45, and a words list in which each entry has text, start and end in seconds. It shows format=true writing the spoken amount as a currency figure. This sample is the illustration printed in the docs. Nothing was run to confirm real output.

A streaming sample in Python and JavaScript connects and waits for transcript.created. It then sends 100 ms audio chunks followed by audio.done, and prints [FINAL] or [partial] lines. It finishes on transcript.done, printing the full transcript and duration.

Assessment & evidence

Limitations and cautions

Documented limits: uploaded files can be at most 500 MB, and larger ones get HTTP 413. Audio can have at most 8 channels. Key-term biasing allows at most 100 terms of up to 50 characters each. Formatting works for only 11 languages and needs the language parameter; format=true without language returns a 400 error. Opus streaming is mono only, so multichannel is not supported with it. Each Opus WebSocket frame must contain exactly one packet, and an undecodable frame causes an error event and closes the session. Container files such as Ogg-Opus or WebM cannot be sent directly as streaming input, because streaming Opus takes raw packets. The page directs container-file transcription to the batch endpoint.

Not specified on the page: accuracy and word-error rates by language, accent or noise condition; diarization accuracy and speaker limits; maximum audio duration; any size limit for audio fetched through the url parameter; measured end-to-end streaming latency; concurrent-connection limits; how well code-switching works beyond the statement that the model follows language switches; and whether all 38+ languages perform equally well.

Inconsistencies in the page worth checking: the client-message list shows {"type": "finalize"} in lower case, while the examples use "Finalize". The Smart Turn text also mixes the term chunk_final with the is_final and speech_final flags.

Other cautions: the Smart Turn confidence figures are vendor claims with no stated test. Fillers are removed by default, so transcripts are not verbatim unless you set filler_words=true. Lowering vad_threshold can add spurious text from background noise.

Nothing here was executed, so none of these behaviours has been verified, including the code samples.

Reasoning behind this assessment

The page is vendor-authored documentation. Its parameter tables, event model and error codes are specific, which makes it a detailed reference for how the API is meant to be called. Its quality claims, such as 'our best transcription model' and 'low-latency', come with no supporting measurements on the page. They are vendor statements, not independent performance evidence.

The page is silent on accuracy, price and privacy, so it cannot settle whether the API fits on any of those points. A decision should rest on a trial with your own audio, languages and accents. None of the documented behaviour has been tested.

The strongest practical points are batch and streaming on one model and broad input format coverage, including telephony formats (mu-law and A-law, with 8 kHz among the supported sample rates). Per-channel transcription offers an alternative to diarization for call recordings, and Smart Turn helps with dictation and voice assistants. The main risks are the unknown cost, unknown data handling and dependence on a single hosted vendor.

Alternatives

The page makes no comparison with other products. Other hosted speech-to-text services and self-hosted speech recognition options are not evaluated here. This source does not establish how they differ from this API in privacy, operations or cost, and their accuracy, price, latency and language coverage were not compared, so no ranking is implied.

From the same vendor, the page points to a Voice Overview and a Text to Speech page, which covers the reverse direction. Those pages are outside the scope of this report.

Evidence base

The source is xAI's own documentation page at [https://docs.x.ai/developers/model-capabilities/audio/speech-to-text.md]. It is vendor documentation made up of parameter tables with types, defaults and ranges, a response schema, a WebSocket event model, an error-code table and illustrative code samples in curl, Python and JavaScript. Every fact here about parameters, defaults, limits, events, languages, formats and status codes comes from that page alone. Linked pages, such as the Voice Overview, Text to Speech and API Reference, are outside the scope.

The page contains no independent performance evidence: no benchmarks, no accuracy or word-error-rate data and no third-party evaluations. Statements about quality, latency and bandwidth savings are the vendor's claims, and the sample response is the page's own illustration. None of the examples or the live service behaviour was tested.

Access & freshness

Costs

Cost is unknown from this resource. The page states no charges per minute or hour of audio, no free allowance or credits, and no billing rules for batch versus streaming. It also does not say where authoritative pricing is published. All of these are unknown from this resource.

The page gives no numeric rate limits or quotas either. It only says an HTTP 429 response means 'rate limited' and recommends backing off and retrying with exponential delay. Developers should confirm any charges, allowances and limits with xAI before planning any volume.

Rights, terms and data handling

The page carries no licence statement and no terms of use. It does not say whether you may reuse or redistribute the documentation text. The code samples are shown for illustration with no stated licence.

Use of the API itself is presumably governed by xAI's own terms, which are not part of this page. The page does not say whether submitted audio or transcripts are stored, used for training or shared. This matters for recordings that contain personal, confidential or regulated speech. It also does not cover consent requirements for transcribing other people, or compliance certifications. All of these are unknown.

The url parameter makes xAI's servers download the audio from an address you supply, and the page's error table lists HTTP 502 when that download fails. The page does not say which URLs the service can reach, whether private or authenticated URLs are supported, or how credentials for such URLs would be supplied. URL access and authentication requirements are unspecified.

Freshness

The page was captured on 15 November 2026. It shows no documentation publication date, last-updated date or changelog. Version information appears in two places. The endpoint paths include /v1 ([https://api.x.ai/v1/stt] and [wss://api.x.ai/v1/stt]), and the only model named is grok-voice-transcribe-2.0, which is the default when model is omitted. The page does not explain what the /v1 path or the 2.0 model name means for compatibility. How often the documentation, the model name or the defaults change is unknown.

This is a live documentation page for a hosted API, and behavior after the capture date is unverified. That includes the vad_threshold defaults, language coverage and limits. Check the live page and the API Reference before building on exact values.

Suggested next steps

Get a key from the xAI console and run the curl quick start on a short recording in your own language. Compare the output with a human transcript to judge accuracy for your accents and noise conditions, since the page offers no accuracy data.

Before sending real recordings, confirm with xAI whether charges apply and what the rate limits, data-retention rules and terms of use are. This page covers none of them.

For live use, build a small backend proxy that holds the API key. Wait for transcript.created before sending audio, use 16 kHz PCM or Opus frames, and set language. Test Smart Turn thresholds with your own speech; the page describes values from 0.5 to 0.9. Check the finalize message casing against the API Reference before relying on it.

Handle errors differently in each mode. For REST, use the page's HTTP status table: 400 for bad requests (such as a missing file or url, an unsupported format, a missing sample_rate for raw audio, or format=true without language), 401 for a missing or invalid key, 413 for files over 500 MB, 429 for rate limiting (back off and retry with exponential delay), 502 when the server fails to download audio from a url you supplied, and 503 when the backend is unavailable (retry). Streaming does not use that table. Instead, handle the documented error event and its message field. Expect most errors, including undecodable audio frames, to close the connection, while client message parse errors keep it open. Tell a normal close after transcript.done apart from a close that follows an error event. With multichannel streaming, wait for one transcript.done per channel.

Evidence for this report

selected-page.txtselected · checked 2026-11-15