Speech to text
Transcribe audio with the AllModels native API, raw HTTP, or a compatible SDK.
AllModels STT endpoint
/v1/sttNative WebSocket/v1/stt is the native AllModels speech-to-text endpoint. It accepts audio as it arrives over a WebSocket and returns normalized, sequenced stt.* events by default. Use event_format=provider when you intentionally want the selected provider's native event stream. In provider mode, upstream frames are forwarded without signal mapping, timestamp rewriting, deduplication, or router-generated JSON events; provider-native text controls are required. This option requires a direct upstream realtime WebSocket. Router-buffered Groq and Fal models have no provider event stream and reject it.
Send binary audio frames and use JSON for native controls:
{"type":"stt.audio.commit"}
{"type":"stt.audio.clear"}
{"type":"stt.session.close"}Transcript updates arrive as stt.transcript.partial and stt.transcript.final. All explicit provider speech activity, acoustic endpoint, and conversational turn decisions arrive as one stt.signal object. Its optional activity.state is started or stopped; its optional boundary.state is opened, candidate, resumed, or final. A final boundary has scope: "utterance" | "turn", so applications can use one response handler across providers without losing the semantic strength of the upstream decision. Transcript finalization and local buffering do not manufacture signals. Applications derive barge-in by combining activity.state=started with their own playback state.
If the complete audio file is already available, use the HTTP, ElevenLabs, or OpenAI examples below. They upload the file through the corresponding compatibility transport.
For microphones, calls, realtime events, and commit strategies, see Stream transcriptions.
Transcribe a file
import { readFile } from "node:fs/promises";const form = new FormData();form.set("file", new Blob([await readFile("call.wav")]), "call.wav");form.set("model", "deepgram/nova-3");form.set("response_format", "verbose_json");const response = await fetch("https://api.allmodels.io/oai/audio/transcriptions", { 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());Field names by client
| Concept | Native /v1/stt | ElevenLabs SDK | OpenAI SDK / HTTP |
|---|---|---|---|
| Audio | Binary WebSocket frames | file | file |
| Model | model query parameter | model_id | model |
| Language | language query parameter | language_code | language |
| Timestamps | Provider option | timestamps_granularity | timestamp_granularities[] |
| Provider preferences | Query parameters | JavaScript request query or Python multipart body | Multipart body |
| Provider options | provider_options query parameters | JavaScript request query or Python multipart body | Multipart body |
See the native STT API reference for connection parameters and SDK Compatibility for ElevenLabs or OpenAI details.
