#error 404 https://elevenlabs.io/docs/developers/guides/cookbooks/speech-to-text/streaming
1 messages · Page 1 of 1 (latest)
Confirmed: as of January 10, 2026, the page at your URL is live and titled “Realtime Speech to Text.” Please try loading it again: https://elevenlabs.io/docs/developers/guides/cookbooks/speech-to-text/streaming. (elevenlabs.io)
If you still see a 404, use the API reference for the Realtime Speech‑to‑Text WebSocket endpoint instead. It documents the wss URL (wss://api.elevenlabs.io/v1/speech-to-text/realtime), required model_id (e.g., scribe_v2_realtime), optional token-based auth, and VAD/manual commit options: https://elevenlabs.io/docs/api-reference/speech-to-text/v-1-speech-to-text-realtime. (elevenlabs.io)
Sources:
Realtime Speech to Text | ElevenLabs Documentation
Realtime | ElevenLabs Documentation
scribble v2 realtime api example
Assuming you mean Scribe v2 Realtime. Below are officially documented, minimal examples.
Client (browser) with token + microphone (React)
- Server: mint a single‑use token for the client.
// Node.js (server)
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
const elevenlabs = new ElevenLabsClient({ apiKey: process.env.ELEVENLABS_API_KEY });
app.get("/scribe-token", yourAuthMiddleware, async (_req, res) => {
const token = await elevenlabs.tokens.singleUse.create("realtime_scribe");
res.json(token);
});
Source: Client-side streaming quickstart. (elevenlabs.io)
- Client: stream the microphone and receive transcripts.
// React (browser)
import { useScribe } from "@elevenlabs/react";
function MyComponent() {
const scribe = useScribe({
modelId: "scribe_v2_realtime",
onPartialTranscript: (d) => console.log("Partial:", d.text),
onCommittedTranscript: (d) => console.log("Committed:", d.text),
onCommittedTranscriptWithTimestamps: (d) => console.log("Timestamps:", d.words),
});
const handleStart = async () => {
const { token } = await (await fetch("/scribe-token")).json();
await scribe.connect({
token,
microphone: { echoCancellation: true, noiseSuppression: true },
});
};
return (
<>
<button onClick={handleStart} disabled={scribe.isConnected}>Start</button>
<button onClick={scribe.disconnect} disabled={!scribe.isConnected}>Stop</button>
</>
);
}
Source: Client-side streaming quickstart. (elevenlabs.io)
Server-side (Python) streaming from an audio URL
from dotenv import load_dotenv
import os, asyncio
from elevenlabs import ElevenLabs, RealtimeEvents, RealtimeUrlOptions
load_dotenv()
async def main():
elevenlabs = ElevenLabs(api_key=os.getenv("ELEVENLABS_API_KEY"))
stop_event = asyncio.Event()
conn = await elevenlabs.speech_to_text.realtime.connect(RealtimeUrlOptions(
model_id="scribe_v2_realtime",
url="https://npr-ice.streamguys1.com/live.mp3",
include_timestamps=True,
))
conn.on(RealtimeEvents.PARTIAL_TRANSCRIPT, lambda d: print("Partial:", d.get("text","")))
conn.on(RealtimeEvents.COMMITTED_TRANSCRIPT, lambda d: print("Committed:", d.get("text","")))
conn.on(RealtimeEvents.COMMITTED_TRANSCRIPT_WITH_TIMESTAMPS, lambda d: print("Timestamps:", d.get("words","")))
conn.on(RealtimeEvents.ERROR, lambda e: (print("Error:", e), stop_event.set()))
conn.on(RealtimeEvents.CLOSE, lambda: print("Closed"))
await stop_event.wait()
await conn.close()
asyncio.run(main())
Source: Server-side streaming guide. (elevenlabs.io)
Raw WebSocket essentials (if you need protocol-level use)
- Endpoint: wss://api.elevenlabs.io/v1/speech-to-text/realtime
- Auth: send xi-api-key header (server) or use token query param (client).
- Required query param: model_id=scribe_v2_realtime
- Typical messages:
• Receive after connect:
{ "message_type": "session_started", ... }
• Send audio chunk (base64 PCM/μ-law):
{ "message_type": "input_audio_chunk", "audio_base_64": "...", "commit": true, "sample_rate": 16000, "previous_text": "optional context" }
• Receive results:
{ "message_type": "partial_transcript", "text": "..." }
{ "message_type": "committed_transcript", "text": "..." }
{ "message_type": "committed_transcript_with_timestamps", "text": "...", "words": [...] }
Full schema,
single use tokens don't work for scribe when sent on query param: {"message_type":"auth_error","error":"You must be authenticated to use this endpoint."}. wss://api.elevenlabs.io/v1/speech-to-text/realtime?token=sutkn_MY_token. Single use token works for TTS. Not STT. Created another apiKey to set the permissions. Same result.