Transcribe one file
Use the synchronous endpoint when the file is available now and your request can wait for a text result.Stream live speech
Use the WebSocket when a person is waiting for words to appear:sample_rate=8000; Hear converts it before recognition and endpointing.
Other sample rates and compressed encodings receive 400 unsupported_audio_format.
Render partial as revisable UI. Commit final as the corrected transcript.
Send {"type":"commit"} when your application must force the current utterance
to finish, and keep streaming silence during normal pauses so server
endpointing can advance.
The streaming guide contains browser capture, framing,
event handling, endpointing, reconnect behavior, and a runnable example.
Process a finished recording
Use async jobs when you need any of these:- Word- or segment-level timestamps.
- Stereo channel separation or mono diarization. If diarization cannot be
produced for a recording, the job completes with mode
transcriptand no speaker labels — check themodefield. - SRT or VTT output.
- A result that survives the submission request.
- Polling or a signed completion webhook.
- Idempotent URL-based submission.
Format final transcripts
All three surfaces support final-text presentation options:numerals: digits or spoken-number form.smart_format: sentence capitalization and punctuation.dictation: spoken punctuation commands.drop_fillers: optional filled-pause removal.vocabulary: request-level or explicitly enabled stored terms for known vocabulary.
Phone audio
Hear streaming accepts PCM16 or Opus. Decode an 8 kHz phone codec before sending PCM16, and do not confuse companding with resampling. The telephony audio reference gives the exact G.711 and sample-rate path.OpenAI compatibility
POST /v1/audio/transcriptions is OpenAI-shaped, so an existing OpenAI client
needs only a new base_url and key. OpenAI model names are accepted as aliases
for pyai-hear: whisper-1, gpt-4o-transcribe, and gpt-4o-mini-transcribe.
An alias is a name and nothing else — the request is always served by Hear, so
the alias never changes the transcript you get.
Stream live speech
Partials, finals, endpointing, audio framing, and browser code.
Transcribe recordings
Timestamps, speakers, subtitles, jobs, and webhooks.
Format transcripts
Numerals, punctuation, dictation, fillers, and vocabulary.
Language support
The Hear language matrix, quality status, and unsupported-language behavior.