allmodels.ioDocs
API ReferenceNative TTS/STT

Native streaming STT (WebSocket)

GET/v1/stt

Opens a WebSocket and emits normalized streaming speech-to-text events. The request must include Upgrade: websocket.

Stream binary audio and use stt.audio.commit, stt.audio.clear, and stt.session.close controls. Server events share a sequenced stt.* envelope. Transcript updates remain separate from a unified flat stt.signal event whose state is started, end_candidate, resumed, or end. Optional turn_scope preserves utterance-versus-turn meaning; it is distinct from transcript-final scope. Only signals explicitly supplied by the selected provider are surfaced.

Use event_format=provider for provider-native passthrough in both directions. Provider-mode server frames are forwarded without signal mapping, timestamp rewriting, deduplication, or router-generated JSON events. This mode requires a direct upstream realtime WebSocket.

audio_format is required and describes the unchanged raw bytes. No resampling, transcoding, or FFmpeg occurs in the streaming path. Portable flat parameters control commits, turn detection, VAD thresholds, partials, timestamps, language detection, keyterms/context, diarization, formatting, and filler words. Unknown bare parameters are rejected. Put provider-native names under provider_options[<name>]; native overrides win except that conflicting encoding/sample-rate/channel declarations return conflicting_audio_format.

Portable input mapping:

FamilyDefault automatic behaviorNative translation / fallback
Deepgram Novaacoustic endpointingendpointing, utterance_end_ms, vad_events
Deepgram Fluxsemantic turnseot_threshold, eager_eot_threshold, eot_timeout_ms
ElevenLabs Scribe realtimeprovider VADcommit_strategy=vad, vad_*, min_*
Soniox realtimeacoustic endpointingenable_endpoint_detection, max_endpoint_delay_ms
AssemblyAI streamingprovider turn detectionmodel-specific turn silence/confidence fields
xAI Grokacoustic; semantic when requestedendpointing or Smart Turn fields
Cartesia ink-2semantic turnsstream_mode=turns; manual selects manual
Cartesia ink-whisperacoustic router VADno provider turn detector; router VAD segments the stream
OpenAI transcriptionserver VADnested turn_detection session object
OpenAI realtime Whisperacoustic router VADprovider detector disabled; router sends native commits
Togetherprovider VADthreshold, min_silence_duration_ms, min_speech_duration_ms

Router VAD supplies turn_detection=acoustic only for OpenAI realtime Whisper and Cartesia ink-whisper. Deepgram Flux has no router-VAD path — its client grammar carries no commit frame — so it serves semantic turn detection only and rejects turn_detection=acoustic with unsupported_stt_option.

Each model family advertises only the portable options it can translate to a native parameter; an explicit option outside that set fails before audio with unsupported_stt_option rather than riding along as a silent no-op. Omitted options fall back to the family's own behavior — interim_results, for example, has no global default. Router VAD can create transcript commits but never manufactures provider-originated stt.signal events, and the signals a session may emit are fixed by the capabilities object echoed in stt.session.started.

Authentication failures close the connection with code 4401 or 4403.

The message-level protocol is documented at the realtime WebSocket reference (AsyncAPI spec: /asyncapi.yaml).

Authorization

BearerAuth
AuthorizationBearer <token>

Tenant key supplied as the Authorization Bearer token.

In: header

Query Parameters

provider?string

Use a specific STT provider.

Value in

  • "deepgram"
  • "elevenlabs"
  • "soniox"
  • "assemblyai"
  • "fish"
  • "groq"
  • "grok"
  • "cartesia"
  • "together"
  • "openai"
  • "gemini"
  • "fal"
  • "cloudflare"
  • "qwen"
  • "inworld"
  • "amazon"
  • "sprag"
model*string

Model id: bare name (nova-3) or {author}/{modelName} slug (deepgram/nova-3). Required — a missing value is refused 400 model_required; the router applies no default model.

language?string

Expected language.

audio_format*string

Actual raw mono audio bytes sent by the client. The router maps this declaration to the provider's native parameters but never resamples or transcodes.

Value in

  • "pcm_8000"
  • "pcm_16000"
  • "pcm_22050"
  • "pcm_24000"
  • "pcm_44100"
  • "pcm_48000"
  • "ulaw_8000"
channels?integer

Input channel count. Defaults to mono (1).

Range1 <= value
Default1
commit_strategy?string

auto uses provider segmentation or reviewed router VAD; manual requires stt.audio.commit.

Default"auto"

Value in

  • "auto"
  • "manual"
turn_detection?string

Automatic detector intent. Explicit acoustic/semantic requests fail if unsupported.

Default"auto"

Value in

  • "auto"
  • "acoustic"
  • "semantic"
silence_duration_ms?number

Trailing silence used for automatic acoustic segmentation.

Range0 <= value
min_speech_duration_ms?number

Minimum speech duration before activation.

Range0 <= value
min_silence_duration_ms?number

Minimum silence duration before a boundary.

Range0 <= value
turn_timeout_ms?number

Maximum wait for a provider turn/endpoint decision.

Range0 <= value
speech_threshold?number

Portable speech/VAD threshold.

Range0 <= value <= 1
turn_threshold?number

Portable semantic end-of-turn threshold.

Range0 <= value <= 1
eager_end_threshold?number

Predictive eager-end threshold; predictive boundaries remain opt-in.

Range0 <= value <= 1
interim_results?boolean

Request mutable transcript hypotheses. There is no global default: when omitted, the selected model family's own behavior applies (false for Deepgram Flux, true elsewhere). The resolved value is echoed in stt.session.started.input_config.interim_results.

include_timestamps?boolean

Request provider timestamps.

include_language_detection?boolean

Request provider language detection metadata.

keyterms?array<string>

Repeated speech-recognition keyterms.

context?string

Recognition context or prompt.

diarization?boolean

Request speaker diarization.

formatting?boolean

Request provider-native transcript formatting.

include_filler_words?boolean

Request filler/disfluency words when supported.

event_format?string

Server/client event grammar. normalized is the default sequenced stt.* contract; provider forwards the selected provider's frames without mapping, rewriting, deduplication, or router-generated JSON events. Provider mode requires a direct upstream realtime WebSocket.

Default"normalized"

Value in

  • "normalized"
  • "provider"
provider_order?array<string>

Comma-separated or repeated provider IDs in preferred order. Providers not listed remain eligible.

provider_only?array<string>

Comma-separated or repeated provider IDs. Only these providers may serve the request.

provider_ignore?array<string>

Comma-separated or repeated provider IDs that must not serve the request.

allow_fallbacks?boolean

Set to false to prevent fallback to another provider. Automatic provider retries are not currently supported.

provider_options?|||||||||||

Provider-specific options in bracket notation, such as provider_options[encoding]=linear16. Provider-native names are accepted only inside this namespace; unknown bare query parameters are rejected.

Header Parameters

Upgrade*string

Must be websocket to perform the protocol upgrade.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

Client
Language
import { readFile } from "node:fs/promises";import WebSocket from "ws";const audioChunk = await readFile("chunk.pcm");const ws = new WebSocket("wss://api.allmodels.io/v1/stt?provider=deepgram&model=deepgram/nova-3&audio_format=pcm_16000&event_format=normalized", {  headers: { Authorization: `Bearer ${process.env.ALLMODELS_API_KEY}` }});ws.on("open", () => {  ws.send(audioChunk);  ws.send(JSON.stringify({ type: "stt.audio.commit" }));});ws.on("message", (data, isBinary) => {  if (isBinary) process.stdout.write(data);  else console.log(JSON.parse(data.toString()));});ws.on("error", console.error);
Empty

{  "error": "invalid_model",  "provider": "soniox",  "model": "bogus",  "supported": [    "stt-rt-v5"  ]}

{  "error": "missing_api_key"}
{  "error": "provider_not_allowed",  "tried": [    "deepgram",    "soniox",    "assemblyai"  ]}
{  "error": "model_not_priced",  "provider": "deepgram",  "model": "flux-general-en"}
{  "error": "websocket_upgrade_required"}
{  "error": "auth_not_initialized"}