> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# STT best practices

> Get the best transcripts from the STT API: audio choices, turn-taking, speech events, Voice Profile, language hints, and custom vocabulary.

- **Audio** — Use MP3/OGG_OPUS for file uploads to reduce size; use LINEAR16 for streaming (required) and when you need highest quality.
- **Streaming** — With manual turn-taking, send `endTurn` at turn boundaries while continuing the session. When done, send `closeStream` once to finalize pending audio and receive usage; do not precede it with another `endTurn`. See the [WebSocket integration guide](https://docs.inworld.ai/api-reference/sttAPI/speechtotext/transcribe-stream-websocket.md) for the complete sequence.
- **Speech events** — Listen for `speechStarted` and `speechStopped` events in the streaming response to detect when a speaker begins and stops talking. Use these to build custom turn-taking logic or visualize voice activity.
- **Voice Profile** — Set `voiceProfileConfig.enableVoiceProfile` to `true` and optionally adjust `topN` (default: 10) to control how many labels per category are returned.
- **Language hint** — If you know the audio's language, set `language` (e.g. `en`, `ja`) for cleaner output; the hint also constrains the output script (see [Language Support](https://docs.inworld.ai/stt/languages.md)). Leave it empty to auto-detect or when speakers switch languages.
- **Custom vocabulary** — Pass domain-specific terms (names, jargon, acronyms) in `prompts` to bias recognition toward them. The bias does not guarantee a match, so test terms the baseline mishears. Keep the list short and targeted. The cap is 100 terms per request, and each term gets a weaker bias as the list grows. A long list is likely to be ignored; a few misheard terms work better than a full glossary.
- **Custom vocabulary characters** — Terms may contain letters and digits in any script, spaces, and `. , ' ( ) : ! ? ; -` (straight apostrophes and hyphens). A term with any other character — `AT&T`, `user_name`, curly quotes, en/em dashes — rejects the **whole request** with a 400 naming the character, so sanitize terms before sending. The model only ever outputs letters, digits, and that same basic punctuation. A spelling like `In@world` cannot appear in a transcript even if it were accepted. Well-known names such as `AT&T` are generally transcribed correctly without prompting.
- Test with sample audio and your target language before production.
