allmodels.ioDocs
API ReferenceElevenLabs SDK

ElevenLabs SDK-compatible realtime STT (WebSocket)

Streams audio and receives ElevenLabs-compatible transcript events with `client.speechToText.realtime.connect(...)`. The request must include `Upgrade: websocket`. **Client → server** frames (JSON): `{ "message_type": "input_audio_chunk", "audio_base_64": "...", "sample_rate": 16000, "commit": true }` **Server → client** frames (JSON), `message_type` one of: `session_started`, `partial_transcript`, `committed_transcript`, `committed_transcript_with_timestamps`, `error`. **Commit strategy.** `commit_strategy=vad` finds utterance boundaries automatically with the model's native turn detection or VAD. Tune it with the `vad_*` / `min_*` params. `auto` is accepted as a legacy alias of `vad`. `commit_strategy=manual` instead lets the client close an utterance explicitly by sending an `input_audio_chunk` frame with `commit: true` (the SDK's `conn.commit()`) and is the compatibility surface's default. With providers that do not support manual commits, completed transcript text is returned together on commit. The ElevenLabs SDK does not support custom headers on this connection. Select a provider with a `<provider>/<model>` value in `model_id`. Use `provider_options` for provider-specific settings. You can also pass supported options directly as query parameters. If both forms set the same option, `provider_options[<name>]=<value>` takes precedence. Recognized enum and boolean option values are case-insensitive and are normalized to each provider's wire spelling; free-form values such as prompts, keyterms, and voice IDs retain their original case. The message-level protocol is documented at [the realtime WebSocket reference](/realtime-reference) (AsyncAPI spec: [/asyncapi.yaml](/asyncapi.yaml)).

GET/el/v1/speech-to-text/realtime

Streams audio and receives ElevenLabs-compatible transcript events with client.speechToText.realtime.connect(...). The request must include Upgrade: websocket.

Client → server frames (JSON): { "message_type": "input_audio_chunk", "audio_base_64": "...", "sample_rate": 16000, "commit": true }

Server → client frames (JSON), message_type one of: session_started, partial_transcript, committed_transcript, committed_transcript_with_timestamps, error.

Commit strategy. commit_strategy=vad finds utterance boundaries automatically with the model's native turn detection or VAD. Tune it with the vad_* / min_* params. auto is accepted as a legacy alias of vad. commit_strategy=manual instead lets the client close an utterance explicitly by sending an input_audio_chunk frame with commit: true (the SDK's conn.commit()) and is the compatibility surface's default. With providers that do not support manual commits, completed transcript text is returned together on commit.

The ElevenLabs SDK does not support custom headers on this connection. Select a provider with a <provider>/<model> value in model_id.

Use provider_options for provider-specific settings. You can also pass supported options directly as query parameters. If both forms set the same option, provider_options[<name>]=<value> takes precedence. Recognized enum and boolean option values are case-insensitive and are normalized to each provider's wire spelling; free-form values such as prompts, keyterms, and voice IDs retain their original case.

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

Authorization

xi-api-key<token>

Tenant key (ElevenLabs SDK convention).

In: header

Query Parameters

model_id?string

Model id: bare name or {author}/{modelName} slug (deepgram/nova-3).

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.

language_code?string
audio_format?string

Input audio format, such as pcm_16000 or ulaw_8000.

keyterms?array<string>

Keyword/keyterm biasing. Repeat the param for multiple terms.

vad_silence_threshold_secs?string

VAD tuning (auto commit): trailing silence, in seconds, that ends an utterance.

vad_threshold?string

VAD tuning (auto commit): speech-probability threshold (0–1) for detecting speech.

min_speech_duration_ms?string

VAD tuning (auto commit): minimum speech length, in ms, before an utterance starts.

min_silence_duration_ms?string

VAD tuning (auto commit): minimum silence length, in ms, before an utterance ends.

include_timestamps?string

When set, committed transcripts include word/char timestamps (committed_transcript_with_timestamps frames).

include_language_detection?string

Request provider language detection metadata where supported.

commit_strategy?string

Utterance segmentation. vad lets the model decide boundaries automatically — its native turn detection or VAD (tune via the vad_* / min_* params); auto is an accepted legacy alias of vad; manual (default) lets the client commit utterances explicitly with an input_audio_chunk frame carrying commit: true (conn.commit()).

Default"manual"

Value in

  • "vad"
  • "manual"
  • "auto"
no_verbatim?string

When set, requests non-verbatim (cleaned/formatted) transcripts where the provider supports it.

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

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/el/v1/speech-to-text/realtime?model_id=deepgram/nova-3&audio_format=pcm_16000&sample_rate=16000", {  headers: { Authorization: `Bearer ${process.env.ALLMODELS_API_KEY}` }});ws.on("open", () => {  ws.send(JSON.stringify({ message_type: "input_audio_chunk", audio_base_64: audioChunk.toString("base64"), sample_rate: 16000, commit: true }));});ws.on("message", (data, isBinary) => {  if (isBinary) process.stdout.write(data);  else console.log(JSON.parse(data.toString()));});ws.on("error", console.error);
Empty
{  "detail": {    "message": "unsupported model 'bogus' for provider 'soniox'",    "status": "invalid_model",    "provider": "soniox",    "model": "bogus",    "supported": [      "stt-rt-v5"    ]  }}
{  "error": "missing_api_key"}
{  "detail": {    "message": "websocket upgrade required",    "status": "websocket_upgrade_required"  }}
{  "detail": {    "message": "authentication was not initialized",    "status": "auth_not_initialized"  }}