Realtime HTTP API
HTTP streaming for bounded Fast input, live audio, diarization, and text-to-speech.
Use these endpoints when HTTP streaming fits your runtime better than Socket.IO. Choose the endpoint from the state of the input—not only from the latency you want.
Direct HTTP only
0.18.0 use Socket.IO and default to /socket.io; they do not call these routes. Use this section when implementing an HTTP client directly.Choose an endpoint
| Endpoint | Input contract | Choose it for |
|---|---|---|
Fast · /http/stt | One complete, bounded audio unit | A finished agent turn, voice command, or short conversational utterance |
Realtime ASR · /http/stt-stream | One framed chunk from audio that is still arriving | Live transcription with partial and final ASR updates |
Realtime diarization · /http/diarization-stream | One framed chunk from audio that is still arriving | Incremental speaker segments for a live stream |
TTS · /http/tts | One JSON request; undelimited binary capture | Inspect the direct protocol; use SDK TTS for playable audio |
Fast is not the long-recording path
Connection and authentication
Build requests from the provisioned API_URL plus the /realtime base path. Send x-api-key from a trusted backend. The key also needs the provisioned capability: realtime ASR for Fast and live ASR, diarization for live diarization, or TTS for synthesis. Request bodies differ by endpoint: multipart for Fast, framed binary for live ASR and diarization, and JSON for TTS.
export API_URL="https://api.voice.humain.com"
export API_KEY="YOUR_API_KEY"Operations
POST · Fast transcription
Upload one complete bounded audio unit and consume streamed transcript events.
POST · Realtime ASR
Send one framed live-audio chunk and consume partial or final ASR output.
POST · Realtime diarization
Send one framed live-audio chunk and consume incremental speaker segments.
POST · Text to speech
Capture the undelimited 16 kHz service protocol; use SDK TTS when you need playable audio.
Production notes
- For live binary requests, keep one stream UUID across chunks and set the start and final flags only at the lifecycle boundaries.
- PCM16 input must be mono, 16 kHz, little-endian, and contain an even number of audio bytes after the control header.
- Send one POST per framed live chunk. A
200response can contain zero or more NDJSON records. Commit completion only after a record withis_final: true; neither the request final bit nor the HTTP response ending proves completion. - For diarization, keep at most one POST in flight per stream UUID and close each response before sending the next frame. Same-UUID overlap can lose response ownership.
- Treat partial transcripts as replaceable display state and final transcripts as committed output. Do not infer ordering from an opaque
seqvalue. - HTTP TTS service frames contain a UUID, final flag, and PCM16 payload but no payload length or delimiter. Generic HTTP read boundaries cannot reliably recover those frames; prefer SDK Socket.IO TTS and the TTS-to-WAV recipe unless your runtime has an explicit framing mechanism.
Next steps
Get transcription job status or result (V1 legacy)
Legacy compatibility operation used by JavaScript and Python SDK `0.18.0`.
Stream fast transcription for one complete audio unit
Transcribe one complete, bounded, latency-sensitive audio unit, such as one finished user turn in an agentic conversation or a voice command.