The synchronous transcription service: audio in, transcript out, one request.

Unlike client.transcripts (which submits a job to the async API and polls for completion), SyncTranscriber posts the audio to the sync API and returns the finished transcript in the HTTP response. There is no job id or status to poll. Accepts a local file path, raw audio bytes, a Blob, or a readable stream — but not a URL.

Hierarchy

  • BaseService
    • SyncTranscriber

Constructors

Methods

  • Parameters

    • input: string
    • Optionalinit: RequestInit

    Returns Promise<Response>

  • Type Parameters

    • T

    Parameters

    • input: string
    • Optionalinit: RequestInit

    Returns Promise<T>

  • Parameters

    • input: string
    • Optionalinit: RequestInit

    Returns Promise<Response>

  • 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.

    Parameters

    • Optionalparams: {
          model?: string;
      }

      Optionally the model to route the probe to, so the warmed connection lands on the same backend as the eventual transcription.

      • Optionalmodel?: string

    Returns Promise<boolean>

    A 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.