Create a new synchronous transcription service.
The parameters to use for the service.
ProtectedfetchProtectedfetchProtectedfetchOpen a live upload that audio is pushed into.
The push-style counterpart of transcribeLive(), for sources that
deliver audio through a callback rather than a stream. The request starts
immediately; call session.write(chunk) from the callback, then
await session.result() for the transcript once the speaker stops. See
SyncLiveSession.
Options for this transcription request. Raw PCM requires
sample_rate and channels.
Client-side options: the request deadline, which must cover the recording.
The open session.
Transcribe audio and return the finished transcript in one request.
The audio travels as a single chunk over the same live upload
transcribeLive() uses — this is the ergonomic shape for audio you
already hold whole, rather than audio still being produced.
A local file path, raw audio bytes, a Blob, or a readable
stream. Raw PCM also requires sample_rate and channels on the config.
Options for this transcription request.
Client-side options: the request deadline and an optional abort signal.
A promise that resolves to the finished transcript.
Transcribe audio uploaded as it is produced.
For audio that is still being produced — a live microphone, an
in-progress call — this starts the request immediately and uploads
chunks as they arrive, so authorization, the upload and every speech
segment but the last resolve while the caller is still recording. What
is left to wait for once they stop is the final segment. Audio already
held whole travels the same connection as a single chunk in
transcribe(), the ergonomic shape for that case.
The saving only pays off when the audio is genuinely still being
produced; audio you already hold whole belongs in transcribe(). It
also needs enough audio to have segments to release early; below
roughly a minute only the elided upload counts. The same 120 s audio
cap applies.
The caller must keep producing: an upload that goes silent for long
enough is aborted server-side. Stop by ending the stream, not by pausing
it. For sources that deliver audio through a callback rather than a
stream, see openLive().
An async iterable (Node streams included), a sync
iterable, or a web ReadableStream of audio chunks. Raw PCM also
requires sample_rate and channels on the config. Audio you already
hold whole belongs in transcribe().
Options for this transcription request.
Client-side options: the request deadline, which must cover the recording, and an optional abort signal.
A promise that resolves to the finished transcript.
Open the connection to the sync API ahead of time.
The sync API is a single request/response, so a transcribe() that
opens its connection on demand pays the full DNS + TCP + TLS handshake
on the critical path. Call warm() as soon as you know audio is coming —
typically while the clip is still being recorded — so the next
transcribe() reuses the already-open connection. warm() is idempotent
and cheap; call it shortly before transcribe() so the pooled connection
hasn't idled out.
Optionalparams: { Optionally the model to route the probe to, so the warmed connection lands on the same backend as the eventual transcription.
Optionalmodel?: stringA promise that resolves to true once the connection is open
(any HTTP response — even a non-200 — means the socket is
established), or false if the connection could not be opened.
The synchronous transcription service: audio in, transcript out, one connection.
Unlike
client.transcripts(which submits a job to the async API and polls for completion),SyncTranscriberposts audio over a live upload to the sync API and returns the finished transcript in the HTTP response. There is no job id or status to poll.transcribe()accepts a local file path, raw audio bytes, a Blob, or a readable stream — but not a URL — and sends it as a single chunk over the same connectiontranscribeLive()andopenLive()use for audio still being produced.