Realtime HTTP API

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

JavaScript and Python SDK 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

EndpointInput contractChoose it for
Fast · /http/sttOne complete, bounded audio unitA finished agent turn, voice command, or short conversational utterance
Realtime ASR · /http/stt-streamOne framed chunk from audio that is still arrivingLive transcription with partial and final ASR updates
Realtime diarization · /http/diarization-streamOne framed chunk from audio that is still arrivingIncremental speaker segments for a live stream
TTS · /http/ttsOne JSON request; undelimited binary captureInspect the direct protocol; use SDK TTS for playable audio

Fast is not the long-recording path

Fast is optimized for a complete but bounded, latency-sensitive unit such as one turn in an agentic conversation. Use Batch for large files, podcasts, long meetings, and archive processing.

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

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 200 response can contain zero or more NDJSON records. Commit completion only after a record with is_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 seq value.
  • 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

On this page