SpyBara
Go Premium

Documentation 2026-11-19 22:57 UTC to 2026-11-20 23:59 UTC

4 files changed +86 −5. View all changes and history on the product overview
2026
Tue 24 23:59 Mon 23 23:59 Fri 20 23:59 Thu 19 22:57 Wed 18 23:57 Tue 17 23:59 Mon 16 23:59 Sun 15 22:59 Fri 13 23:57 Thu 12 22:57 Wed 11 23:00 Tue 10 23:57 Mon 9 23:00 Sun 8 23:57 Sat 7 22:59 Fri 6 23:59 Thu 5 23:58 Wed 4 23:01 Tue 3 23:00 Mon 2 23:57 Sun 1 23:02
Details

2 2 

3# Speech to Text3# Speech to Text

4 4 

5Transcribe audio files into text with a single API call, or stream audio in real time over WebSocket. The API supports 15 audio formats, word-level timestamps, multichannel transcription, and text formatting.5Transcribe audio files into text with a single API call, or stream audio in real time over WebSocket. The API supports 15 audio formats, word-level timestamps, multichannel transcription, text formatting, and redaction of sensitive data.

6 6 

7## Quick Start7## Quick Start

8 8 


154| `multichannel` | boolean | `false` | | When `true`, transcribes each audio channel independently. Results returned in the `channels` array. |154| `multichannel` | boolean | `false` | | When `true`, transcribes each audio channel independently. Results returned in the `channels` array. |

155| `channels` | integer | | | Number of audio channels (2–8). Only required for multichannel raw audio. Auto-detected for container formats. |155| `channels` | integer | | | Number of audio channels (2–8). Only required for multichannel raw audio. Auto-detected for container formats. |

156| `diarize` | boolean | `false` | | When `true`, enables speaker diarization. Each word in the response includes a `speaker` field (integer) identifying the detected speaker. |156| `diarize` | boolean | `false` | | When `true`, enables speaker diarization. Each word in the response includes a `speaker` field (integer) identifying the detected speaker. |

157| `keyterm` | string | | | A key term to bias transcription toward (e.g. product names, proper nouns). Repeat the field for multiple terms (e.g. `keyterm=Understand+The+Universe`). Max 100 terms, each up to 50 characters. |157| `keyterm` | string | | | A key term to bias transcription toward (e.g. product names, proper nouns). Repeat the field for multiple terms (e.g. `keyterm=Understand The Universe`). Max 100 terms, each up to 50 characters. |

158| `filler_words` | boolean | `false` | | When `true`, filler words (e.g. "uh", "um", "er") are included in the transcript. When `false` (default), filler words are automatically removed from the transcript text and the `words` array. |158| `filler_words` | boolean | `false` | | When `true`, filler words (e.g. "uh", "um", "er") are included in the transcript. When `false` (default), filler words are automatically removed from the transcript text and the `words` array. |

159| `vad_threshold` | number | `0.5` | | Speech-probability threshold for the voice-activity gate (0.0–1.0). Audio segments scoring below the threshold are treated as non-speech and skipped for transcription. Lower values transcribe quieter or noisier speech (e.g. narrowband telephony) but may produce spurious text for background noise. `0` disables the gate. |159| `vad_threshold` | number | `0.5` | | Speech-probability threshold for the voice-activity gate (0.0–1.0). Audio segments scoring below the threshold are treated as non-speech and skipped for transcription. Lower values transcribe quieter or noisier speech (e.g. narrowband telephony) but may produce spurious text for background noise. `0` disables the gate. |

160| `redact` | string | | | Types of sensitive data to replace with tags: `pii`, `pci`, `phi`, or a single type such as `ssn`. Repeat the field for multiple values. See [Redaction](#redaction). |

161| `show_redacted_text` | boolean | `false` | | When `true`, each redacted word in the response includes a `redacted_text` field with the original words. Only applies with `redact`. |

160 162 

161† Either `file` or `url` must be provided.163† Either `file` or `url` must be provided.

162 164 


199| `text` | string | Full transcript text. |201| `text` | string | Full transcript text. |

200| `language` | string | Detected language as a BCP-47 code (e.g. `en`, `es-mx`). |202| `language` | string | Detected language as a BCP-47 code (e.g. `en`, `es-mx`). |

201| `duration` | number | Audio duration in seconds (3 d.p.). |203| `duration` | number | Audio duration in seconds (3 d.p.). |

202| `words` | array | Word-level segments with `text`, `start`, `end`, and `speaker` (integer, only when `diarize=true`). |204| `words` | array | Word-level segments with `text`, `start`, `end`, `speaker` (integer, only when `diarize=true`), and `redacted_text` (only when `show_redacted_text=true`). |

203| `channels` | array | Per-channel transcripts (only when `multichannel=true`). Each entry has `index`, `text`, and `words`. |205| `channels` | array | Per-channel transcripts (only when `multichannel=true`). Each entry has `index`, `text`, and `words`. |

204 206 

207## Redaction

208 

209Set `redact` to replace sensitive values in the transcript with tags such as `[NAME_1]`, on both the REST and WebSocket endpoints.

210 

211```bash

212curl -X POST https://api.x.ai/v1/stt \

213 -H "Authorization: Bearer $XAI_API_KEY" \

214 -F format=true \

215 -F language=en \

216 -F redact=pii \

217 -F redact=pci \

218 -F file=@call.mp3

219```

220 

221```json

222{

223 "text": "Hi, my name is [NAME_1]. My card number is [CREDIT_CARD_1].",

224 "language": "en",

225 "duration": 8.673,

226 "words": [

227 { "text": "Hi,", "start": 0.12, "end": 0.34 },

228 { "text": "my", "start": 0.601, "end": 0.721 },

229 { "text": "name", "start": 0.761, "end": 0.901 },

230 { "text": "is", "start": 0.921, "end": 1.001 },

231 { "text": "[NAME_1]", "start": 1.082, "end": 1.422 },

232 { "text": ".", "start": 1.522, "end": 2.003 },

233 { "text": "My", "start": 2.444, "end": 2.564 },

234 { "text": "card", "start": 2.604, "end": 2.824 },

235 { "text": "number", "start": 2.864, "end": 3.084 },

236 { "text": "is", "start": 3.145, "end": 3.225 },

237 { "text": "[CREDIT_CARD_1]", "start": 3.325, "end": 8.092 },

238 { "text": ".", "start": 8.192, "end": 8.372 }

239 ]

240}

241```

242 

243**How it works:**

244 

245* A tag is `[TYPE_N]`. The same value keeps its number, so every `[NAME_1]` in a response or streaming session is the same name.

246* Tags replace the values in `text`, `words`, and `channels`.

247* `show_redacted_text=true` adds the original words to each redacted word as `redacted_text`. REST only.

248* Streaming sends no interim results while `redact` is set. Chunk-final and utterance-final events arrive redacted.

249* If redaction cannot run, the request fails instead of returning the unredacted transcript: `503` on REST, an `error` event on WebSocket.

250 

251`redact` accepts a group, a single type, or several of either:

252 

253| Value | Types |

254|-------|-------|

255| `pii` | `name`, `name_given`, `name_family`, `name_medical_professional`, `username`, `password`, `phone_number`, `email_address`, `ip_address`, `url`, `filename`, `location`, `location_address`, `location_city`, `location_state`, `location_zip`, `location_country`, `location_coordinate`, `ssn`, `passport_number`, `vehicle_id`, `healthcare_number`, `account_number`, `numerical_pii`, `dob`, `age`, `date`, `date_interval`, `time`, `duration`, `money`, `organization`, `organization_medical_facility`, `occupation`, `event`, `language`, `origin`, `religion`, `political_affiliation`, `marital_status`, `gender_sexuality`, `physical_attribute`, `zodiac_sign` |

256| `pci` | `credit_card`, `credit_card_expiration`, `cvv` |

257| `phi` | `condition`, `drug`, `dose`, `injury`, `blood_type`, `medical_process`, `statistics` |

258| Ungrouped | `bank_account`, `routing_number`, `drivers_license`, `pin` |

259 

260`pii` leaves card details, bank account numbers, and routing numbers in the transcript. Add `pci`, `bank_account`, and `routing_number` to redact them.

261 

262Redaction is tuned for English, Spanish, French, German, and Portuguese. It costs $0.05 per hour of audio on top of transcription.

263 

205## Supported Audio Formats264## Supported Audio Formats

206 265 

207### Container formats (auto-detected)266### Container formats (auto-detected)


266| `smart_turn` | number | | End-of-turn detection threshold (0.0–1.0). When set, enables Smart Turn — an ML model predicts whether the speaker has finished their thought at each silence boundary. See [Smart Turn](#smart-turn). |325| `smart_turn` | number | | End-of-turn detection threshold (0.0–1.0). When set, enables Smart Turn — an ML model predicts whether the speaker has finished their thought at each silence boundary. See [Smart Turn](#smart-turn). |

267| `smart_turn_timeout` | integer | | Maximum silence duration (ms) before forcing `speech_final`, even when the Smart Turn model predicts the speaker hasn't finished. Range: 1–5000. Only applies when `smart_turn` is enabled. See [Smart Turn](#smart-turn). |326| `smart_turn_timeout` | integer | | Maximum silence duration (ms) before forcing `speech_final`, even when the Smart Turn model predicts the speaker hasn't finished. Range: 1–5000. Only applies when `smart_turn` is enabled. See [Smart Turn](#smart-turn). |

268| `vad_threshold` | number | `0.08` | Speech-probability threshold for the voice-activity gate (0.0–1.0). Audio in chunks scoring below the threshold is treated as non-speech and skipped for transcription. Lower values transcribe quieter or noisier speech (e.g. narrowband telephony) but may produce spurious text for background noise. `0` disables the gate. Does not affect endpointing or `speech_final` timing. |327| `vad_threshold` | number | `0.08` | Speech-probability threshold for the voice-activity gate (0.0–1.0). Audio in chunks scoring below the threshold is treated as non-speech and skipped for transcription. Lower values transcribe quieter or noisier speech (e.g. narrowband telephony) but may produce spurious text for background noise. `0` disables the gate. Does not affect endpointing or `speech_final` timing. |

328| `redact` | string | | Types of sensitive data to replace with tags. Repeat the parameter for multiple values. Interim results are not sent when set. See [Redaction](#redaction). |

269 329 

270### Server Events330### Server Events

271 331 


501| Status | Meaning | Action |561| Status | Meaning | Action |

502|--------|---------|--------|562|--------|---------|--------|

503| `200` | Success | Transcription in the response body |563| `200` | Success | Transcription in the response body |

504| `400` | Bad request | Missing `file`/`url`, unsupported format, missing `sample_rate` for raw audio, `format=true` without `language` |564| `400` | Bad request | Missing `file`/`url`, unsupported format, missing `sample_rate` for raw audio, `format=true` without `language`, unsupported `redact` value |

505| `401` | Unauthorized | API key is missing or invalid |565| `401` | Unauthorized | API key is missing or invalid |

506| `413` | Payload too large | File exceeds 500 MB |566| `413` | Payload too large | File exceeds 500 MB |

507| `429` | Rate limited | Back off and retry with exponential delay |567| `429` | Rate limited | Back off and retry with exponential delay |

508| `502` | Bad gateway | URL download failed (when using `url`) |568| `502` | Bad gateway | URL download failed (when using `url`) |

509| `503` | Service unavailable | Backend not available — retry |569| `503` | Service unavailable | Backend not available, or redaction could not run — retry |

510 570 

511## Related571## Related

512 572 

rate-limits.md +1 −0

Details

39| grok-4.3 | T0: 37, T1: 50, T2: 75, T3: 125, T4: 208 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |39| grok-4.3 | T0: 37, T1: 50, T2: 75, T3: 125, T4: 208 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |

40| grok-4.20-0309-reasoning | T0: 37, T1: 50, T2: 75, T3: 125, T4: 208 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |40| grok-4.20-0309-reasoning | T0: 37, T1: 50, T2: 75, T3: 125, T4: 208 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |

41| grok-4.20-0309-non-reasoning | T0: 37, T1: 50, T2: 75, T3: 125, T4: 208 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |41| grok-4.20-0309-non-reasoning | T0: 37, T1: 50, T2: 75, T3: 125, T4: 208 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |

42| grok-build-0.1 | T0: 37, T1: 50, T2: 75, T3: 125, T4: 208 | T0: 10M, T1: 15M, T2: 25M, T3: 45M, T4: 85M |

42| grok-4.20-multi-agent-0309 | T0: 9, T1: 12, T2: 18, T3: 31, T4: 56 | T0: 2.5M, T1: 3.7M, T2: 6.2M, T3: 11M, T4: 21M |43| grok-4.20-multi-agent-0309 | T0: 9, T1: 12, T2: 18, T3: 31, T4: 56 | T0: 2.5M, T1: 3.7M, T2: 6.2M, T3: 11M, T4: 21M |

43| grok-imagine-image | T0: 6, T1: 12, T2: 25, T3: 50, T4: 100 | — |44| grok-imagine-image | T0: 6, T1: 12, T2: 25, T3: 50, T4: 100 | — |

44| grok-imagine-image-2.0 | T0: 6, T1: 12, T2: 25, T3: 50, T4: 100 | — |45| grok-imagine-image-2.0 | T0: 6, T1: 12, T2: 25, T3: 50, T4: 100 | — |

Details

34 34 

35* `vad_threshold` (number) — Speech-probability threshold for the voice-activity gate (0.0–1.0). Audio segments scoring below the threshold are treated as non-speech and skipped for transcription. Lower values transcribe quieter or noisier speech (e.g. narrowband telephony) but may produce spurious text for background noise; \`0\` disables the gate entirely. Default: \`0.5\`.35* `vad_threshold` (number) — Speech-probability threshold for the voice-activity gate (0.0–1.0). Audio segments scoring below the threshold are treated as non-speech and skipped for transcription. Lower values transcribe quieter or noisier speech (e.g. narrowband telephony) but may produce spurious text for background noise; \`0\` disables the gate entirely. Default: \`0.5\`.

36 36 

37* `redact` (array\<string>) — Types of sensitive data to replace with tags such as \`\[NAME\_1]\`: \`pii\`, \`pci\`, \`phi\`, or a single type such as \`ssn\`. Repeat the field for each value.

38 

39* `show_redacted_text` ("true" | "false") — When \`true\`, each redacted word in the response includes a \`redacted\_text\` field with the original words. Only applies with \`redact\`.

40 

37### Response Body41### Response Body

38 42 

39* `text` (string, required) — Full transcript text. For multichannel requests, this is a merged transcript across all channels (words interleaved by timestamp).43* `text` (string, required) — Full transcript text. For multichannel requests, this is a merged transcript across all channels (words interleaved by timestamp).


52 56 

53 * `speaker` (integer) — Speaker index (0-based). Only present when \`diarize=true\`.57 * `speaker` (integer) — Speaker index (0-based). Only present when \`diarize=true\`.

54 58 

59 * `redacted_text` (string) — The original words a redaction tag replaced. Only present when \`show\_redacted\_text=true\`.

60 

55* `channels` (array\<object>) — Per-channel transcripts. Only present when \`multichannel=true\`. Omitted for single-channel audio.61* `channels` (array\<object>) — Per-channel transcripts. Only present when \`multichannel=true\`. Omitted for single-channel audio.

56 62 

57 * `index` (integer, required) — Zero-based channel index in the source audio.63 * `index` (integer, required) — Zero-based channel index in the source audio.


70 76 

71 * `speaker` (integer) — Speaker index (0-based). Only present when \`diarize=true\`.77 * `speaker` (integer) — Speaker index (0-based). Only present when \`diarize=true\`.

72 78 

79 * `redacted_text` (string) — The original words a redaction tag replaced. Only present when \`show\_redacted\_text=true\`.

80 

73\*\*Response example:\*\*81\*\*Response example:\*\*

74 82 

75```json83```json


164 172 

165* `vad_threshold` (number, optional, default: 0.08) — Speech-probability threshold for the voice-activity gate (0.0–1.0). Audio in chunks scoring below the threshold is treated as non-speech and skipped for transcription. Lower values transcribe quieter or noisier speech (e.g. narrowband telephony) but may produce spurious text for background noise; \`0\` disables the gate entirely. Does not affect endpointing or \`speech\_final\` timing. Default: \`0.08\`.173* `vad_threshold` (number, optional, default: 0.08) — Speech-probability threshold for the voice-activity gate (0.0–1.0). Audio in chunks scoring below the threshold is treated as non-speech and skipped for transcription. Lower values transcribe quieter or noisier speech (e.g. narrowband telephony) but may produce spurious text for background noise; \`0\` disables the gate entirely. Does not affect endpointing or \`speech\_final\` timing. Default: \`0.08\`.

166 174 

175* `redact` (string (repeatable), optional) — Types of sensitive data to replace with tags such as \`\[NAME\_1]\`: \`pii\`, \`pci\`, \`phi\`, or a single type such as \`ssn\`. Repeat the parameter for each value. Interim results are not sent when set.

176 

167### Client Messages177### Client Messages

168 178 

169* `Binary frame (audio)` — Send raw audio as binary WebSocket frames in the encoding specified by the \`encoding\` query parameter. Audio should be streamed in real-time-paced chunks (e.g. 100 ms at a time). No base64 encoding — send raw bytes directly. With \`encoding=opus\`, each binary frame must contain exactly one raw Opus packet — never concatenate packets or split one across frames. An undecodable frame sends an \`error\` event and closes the session.179* `Binary frame (audio)` — Send raw audio as binary WebSocket frames in the encoding specified by the \`encoding\` query parameter. Audio should be streamed in real-time-paced chunks (e.g. 100 ms at a time). No base64 encoding — send raw bytes directly. With \`encoding=opus\`, each binary frame must contain exactly one raw Opus packet — never concatenate packets or split one across frames. An undecodable frame sends an \`error\` event and closes the session.

Details

1032 1032 

1033* `vad_threshold` (number) — Speech-probability threshold for the voice-activity gate (0.0–1.0). Audio segments scoring below the threshold are treated as non-speech and skipped for transcription. Lower values transcribe quieter or noisier speech (e.g. narrowband telephony) but may produce spurious text for background noise; \`0\` disables the gate entirely. Default: \`0.5\`.1033* `vad_threshold` (number) — Speech-probability threshold for the voice-activity gate (0.0–1.0). Audio segments scoring below the threshold are treated as non-speech and skipped for transcription. Lower values transcribe quieter or noisier speech (e.g. narrowband telephony) but may produce spurious text for background noise; \`0\` disables the gate entirely. Default: \`0.5\`.

1034 1034 

1035* `redact` (array\<string>) — Types of sensitive data to replace with tags such as \`\[NAME\_1]\`: \`pii\`, \`pci\`, \`phi\`, or a single type such as \`ssn\`. Repeat the field for each value.

1036 

1037* `show_redacted_text` ("true" | "false") — When \`true\`, each redacted word in the response includes a \`redacted\_text\` field with the original words. Only applies with \`redact\`.

1038 

1035### Response Body1039### Response Body

1036 1040 

1037* `text` (string, required) — Full transcript text. For multichannel requests, this is a merged transcript across all channels (words interleaved by timestamp).1041* `text` (string, required) — Full transcript text. For multichannel requests, this is a merged transcript across all channels (words interleaved by timestamp).


1050 1054 

1051 * `speaker` (integer) — Speaker index (0-based). Only present when \`diarize=true\`.1055 * `speaker` (integer) — Speaker index (0-based). Only present when \`diarize=true\`.

1052 1056 

1057 * `redacted_text` (string) — The original words a redaction tag replaced. Only present when \`show\_redacted\_text=true\`.

1058 

1053* `channels` (array\<object>) — Per-channel transcripts. Only present when \`multichannel=true\`. Omitted for single-channel audio.1059* `channels` (array\<object>) — Per-channel transcripts. Only present when \`multichannel=true\`. Omitted for single-channel audio.

1054 1060 

1055 * `index` (integer, required) — Zero-based channel index in the source audio.1061 * `index` (integer, required) — Zero-based channel index in the source audio.


1068 1074 

1069 * `speaker` (integer) — Speaker index (0-based). Only present when \`diarize=true\`.1075 * `speaker` (integer) — Speaker index (0-based). Only present when \`diarize=true\`.

1070 1076 

1077 * `redacted_text` (string) — The original words a redaction tag replaced. Only present when \`show\_redacted\_text=true\`.

1078 

1071\*\*Response example:\*\*1079\*\*Response example:\*\*

1072 1080 

1073```json1081```json


1162 1170 

1163* `vad_threshold` (number, optional, default: 0.08) — Speech-probability threshold for the voice-activity gate (0.0–1.0). Audio in chunks scoring below the threshold is treated as non-speech and skipped for transcription. Lower values transcribe quieter or noisier speech (e.g. narrowband telephony) but may produce spurious text for background noise; \`0\` disables the gate entirely. Does not affect endpointing or \`speech\_final\` timing. Default: \`0.08\`.1171* `vad_threshold` (number, optional, default: 0.08) — Speech-probability threshold for the voice-activity gate (0.0–1.0). Audio in chunks scoring below the threshold is treated as non-speech and skipped for transcription. Lower values transcribe quieter or noisier speech (e.g. narrowband telephony) but may produce spurious text for background noise; \`0\` disables the gate entirely. Does not affect endpointing or \`speech\_final\` timing. Default: \`0.08\`.

1164 1172 

1173* `redact` (string (repeatable), optional) — Types of sensitive data to replace with tags such as \`\[NAME\_1]\`: \`pii\`, \`pci\`, \`phi\`, or a single type such as \`ssn\`. Repeat the parameter for each value. Interim results are not sent when set.

1174 

1165### Client Messages1175### Client Messages

1166 1176 

1167* `Binary frame (audio)` — Send raw audio as binary WebSocket frames in the encoding specified by the \`encoding\` query parameter. Audio should be streamed in real-time-paced chunks (e.g. 100 ms at a time). No base64 encoding — send raw bytes directly. With \`encoding=opus\`, each binary frame must contain exactly one raw Opus packet — never concatenate packets or split one across frames. An undecodable frame sends an \`error\` event and closes the session.1177* `Binary frame (audio)` — Send raw audio as binary WebSocket frames in the encoding specified by the \`encoding\` query parameter. Audio should be streamed in real-time-paced chunks (e.g. 100 ms at a time). No base64 encoding — send raw bytes directly. With \`encoding=opus\`, each binary frame must contain exactly one raw Opus packet — never concatenate packets or split one across frames. An undecodable frame sends an \`error\` event and closes the session.