allmodels.ioDocs
API ReferenceElevenLabs SDK

ElevenLabs SDK-compatible STT (file upload)

Transcribes an uploaded audio file with `client.speechToText.convert(...)`. Supported formats are WAV, MP3, FLAC, MP4/M4A, OGG, and WebM. Unsupported or unreadable files return `422 indeterminate_audio_duration`. 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.

POST/el/v1/speech-to-text

Transcribes an uploaded audio file with client.speechToText.convert(...). Supported formats are WAV, MP3, FLAC, MP4/M4A, OGG, and WebM. Unsupported or unreadable files return 422 indeterminate_audio_duration.

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.

Authorization

xi-api-key<token>

Tenant key (ElevenLabs SDK convention).

In: header

Query Parameters

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. You can also pass supported options directly as query parameters. If both forms set the same option, the bracketed value takes precedence.

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Audio file and transcription options.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

Client
Language
import { open } from "node:fs/promises";const file = await open("call.wav");const form = new FormData();form.set("file", new Blob([await file.readFile()], { type: "audio/wav" }), "call.wav");form.set("model_id", "deepgram/nova-3");form.set("timestamps_granularity", "word");const response = await fetch("https://api.allmodels.io/el/v1/speech-to-text", {  method: "POST",  headers: { Authorization: `Bearer ${process.env.ALLMODELS_API_KEY}` },  body: form});if (!response.ok) throw new Error(`AllModels request failed: ${response.status}`);console.log(await response.json());
{  "language_code": "en",  "language_probability": 0.98,  "text": "Hello from AllModels.",  "words": [    {      "text": "Hello",      "start": 0,      "end": 0.4,      "type": "word"    }  ]}

{  "detail": {    "message": "invalid multipart body",    "status": "invalid_multipart"  }}

{  "error": "missing_api_key"}

{  "detail": {    "message": "this organization has insufficient prepaid balance",    "status": "insufficient_balance"  }}

{  "error": "tenant_disabled"}

{  "detail": {    "loc": [      "body",      "file"    ],    "msg": "field required",    "type": "value_error.missing"  }}

{  "detail": {    "message": "provider 'example-provider' does not support file transcription",    "status": "transcription_not_supported",    "provider": "example-provider"  }}
{  "detail": {    "message": "upstream text-to-speech request failed",    "status": "upstream_error"  }}

ElevenLabs SDK-compatible streaming-input TTS (WebSocket) GET

Streams text into TTS with the ElevenLabs WebSocket protocol. Use it to start generating audio before all of the text is available. The request must include `Upgrade: websocket`. **Client → server** frames (JSON): - `{ "text": " ", "voice_settings": { "speed": 1.0 }, "generation_config": {...} }` — optional init frame (single space). See the `VoiceSettings` schema for the supported keys; `speed` is honored across providers. - `{ "text": "Hello ", "try_trigger_generation": true }` — append text. - `{ "text": "world.", "flush": true }` — append and force generation. - `{ "text": "", "flush": true }` — flush without closing. - `{ "text": "" }` — close the stream. **Server → client** frames (JSON): - `{ "audio": "<base64 bytes>" }` — one frame per audio chunk. - `{ "audio": null, "error": "<code>", "code": "<status>" }` — error. Text is buffered by default to improve prosody across message boundaries. Two ElevenLabs-only options control buffering: - `auto_mode` (query param) — disables buffering; audio is generated per message rather than across the buffer. - `generation_config.chunk_length_schedule` (init-frame field) — tunes the buffer size, e.g. the init frame `{ "text": " ", "generation_config": { "chunk_length_schedule": [50] } }`. The `try_trigger_generation` and `flush` fields are supported by ElevenLabs, Deepgram, Grok, and Fish. MiniMax does not support mid-stream flushing. Deepgram WebSocket TTS supports only `pcm_*` and `ulaw_*`. Requesting `mp3_*` returns `400 invalid_output_format`. 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)).

ElevenLabs SDK-compatible realtime STT (WebSocket) GET

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)).