Speech-to-Text
Transcribe audio files to text. A single endpoint serves three modes — default async, opt-in streaming, opt-in sync — controlled by query parameters.Edge endpoints accept your
pg_* API key as a bearer token. See Authentication for details. The cURL examples below pin Toronto (yto-01) for concreteness — substitute another region or discover the fastest one via GET https://autorouter.polargrid.ai/v1/route.Transcribe Audio
file. Everything else is a query parameter.
Query Parameters
Three Modes
stream=true and sync=true are mutually exclusive.
OpenAI SDK Drop-In
OpenAI’s transcription endpoint is strictly synchronous, and stock OpenAI SDKs sendmodel, language, response_format, and temperature as
multipart form fields — they have no way to add query parameters. The
endpoint accepts both shapes:
- Form fields are honored as fallbacks for any query parameter you don’t set (query always wins when both are present).
- A request whose
modelarrives as a form field with no mode flags is served synchronously — a stock OpenAI SDK gets the transcript inline, exactly as it does against OpenAI.
The async-job default (
202 + poll_url) applies only to PolarGrid-style
requests that pass model as a query parameter. If you build raw requests
and want inline results, pass ?sync=true.Available Models
Examples
Default — async job
Streaming — SSE
Sync — blocking request
Cohere model — same surface, different model id
cohere-transcribe-03-2026 supports the same
sync, stream, and async modes. Swap the model query parameter — everything
else is identical:
en when language is omitted. The audio is still transcribed correctly (the model is multilingual), but the language field in the response will report en rather than the spoken language. Pass language explicitly (e.g. &language=fr) whenever you need the response metadata to reflect the actual language.
Live Streaming — WebSocket
- Connect with
?token=<pg_* key or session JWT>; optionalmodel,language,prompt,window_squery params - Send binary frames: 16 kHz mono little-endian 16-bit PCM
- Send
{"type":"stop"}(text frame) to end the utterance - Receive the same event vocabulary as SSE:
transcript.text.deltaper ~1 s window of new audio, then one authoritativetranscript.text.doneafterstop(see Delta semantics — deltas are provisional display hints, not concatenable fragments)
done lands 159 ms p50 / 205 ms p95 after
the stop marker — the effective end-of-speech-to-transcript latency for a
voice agent on this surface. See the
whisper-large-v3-turbo model card for the
full table.
SSE Event Types
Terminated by
data: [DONE]\n\n (SSE surface only).
Delta semantics
Applies to both the SSE and WebSocket surfaces, which share the same engine. Each window re-transcribes the full audio buffered so far, producing a new hypothesis. Thedelta field then carries one of two things:
- the new suffix, when the new hypothesis extends the previous one
unchanged (e.g.
" This is a short."), or - the full revised hypothesis, when re-decoding changed earlier text
(e.g.
"Hello. This is a short test phrase for").
done.text — it is the
only authoritative value, produced by a fresh pass over the complete audio.
Polling Responses
GET /v1/audio/transcriptions?job_id=... returns:
202while the job isaccepted/processing—{ job_id, status, poll_interval_ms }200whencompleted— formatted body, withjob_idandstatus: "completed"400onfailed/cancelled
Supported Audio Formats
MP3, WAV, M4A, OGG, FLAC, WebMLimits
ffmpeg -f segment), submit each segment as its own request — the
default async mode is built for this — and concatenate the transcripts.
Splitting on silence rather than fixed intervals avoids cutting words in
half.