wss://api.withhopper.com/stt/websocket transcribes audio as it arrives. Stream binary PCM16 frames and receive partial transcripts while the speaker is talking, then a final transcript when the turn ends. The model is Nemotron ASR, NVIDIA’s open speech-to-text model, served by Hopper with turn detection built in. To transcribe a complete file in one HTTP request, use batch transcription.
Authenticate at upgrade with Authorization: Bearer sk_hopper_..., or pass ?api_key=sk_hopper_... from clients that cannot set headers.
Connection parameters
All configuration is query parameters on the connect URL.Turn detection presets
Start with a preset. Override individual thresholds only if the preset misses for your callers.
Message protocol
Client to server:- Binary frames: raw PCM16 mono audio at the negotiated
sample_rate. 100 ms per frame is the reference pacing. These bytes are what gets metered. - Text frame
"END": flush — the server finalizes any buffered audio.
{"type": "Ready"}— sent once when the session is ready. Send audio after this.- Transcript events:
{"text": "...", "is_final": false}partials while a turn is in progress,is_final: truewhen it ends; final events carrywordswith per-wordstart/endtimestamps when available. - Text frame
"END"— echoed after a flush completes; all finals have been delivered.
Example
Stream a raw PCM16 file at real-time pace and print transcripts as they arrive.Upgrade errors
Failures at upgrade time are written to the socket as a raw HTTP response with the standard error envelope before any WebSocket frames.Billing
Streaming transcription costs $0.30 per hour of audio, metered on the binary bytes you send:audio_seconds = bytes / (sample_rate × 2). Usage settles against your balance every 60 s during the session and again at close.