Skip to main content

Speech-to-text

Sellable product

This capability is granted by an API key scoped to the speech-api product (product face). See the product reference below.

Speech-to-text as a shared capability, in TWO modes. BATCH (REST, below): POST audio inline (audio_base64, sync) or by URL (audio_url, async enqueue); provider abstraction with ordered fallback (Deepgram→Whisper→Gemini), per-provider circuit-breaker, durable PG-backed queue, SSRF-guarded URL fetch. STREAMING (WebSocket /audio-stream, see x-streaming): real-time μ-law/PCM audio frames → Deepgram streaming → live transcript finals; the production voice-telephony path. Audio bytes are NEVER persisted; provider keys NEVER in body/DB/logs (resolved server-side, Infisical-rendered).

  • Group: Voice & AI
  • Contract: contracts/stt/v1/openapi.yaml
  • Public base: https://api.vagarylabs.com (the consolidated API gateway — one host, per-brand sibling api.<zone>)
  • Auth: a product API key (vgk_…) issued from the console — Authorization: Bearer vgk_…
  • Product face (customer-keyed):
    • https://api.vagarylabs.com/product/v1/speech/transcriptions
  • Capability face (internal first-party — NOT customer-keyed):
    • https://api.vagarylabs.com/v1/transcribe

Endpoints

MethodPathSummary
POST/v1/transcribeTranscribe audio — sync (audio_base64) or async (audio_url). Exactly one of the two.
GET/v1/transcribe/&#123;id&#125;Job status + transcript when done
GET/healthDB reachability gate (open)
GET/metricsPrometheus text exposition (open)

Product face

The external, paying-customer surface served by the edge at /product/v1/* (contracts/stt/product/v1/openapi.yaml).

MethodPathSummary
POST/transcriptionsTranscribe audio (managed, metered) — wraps the capability's batch transcribe

Schemas

TranscribeRequest

exactly ONE of audio_url or audio_base64 is required

FieldTypeDescription
organization_idstringPRODUCT-TIER end-customer tenant (I6); defaults to service default_org
audio_urlstringSSRF-guarded fetch (re-validated at fetch time); implies async
audio_base64stringinline audio (sync); capped per config.audio.maxInlineBytes
content_typestring
languagestring
promptstringoptional Whisper biasing prompt (proper nouns / domain vocabulary); applied only by the Whisper provider, ignored by others
providerstringrequest a specific provider; otherwise ordered fallback
idempotency_keystring
asyncbooleanforce async even with inline audio
max_attemptsinteger

TranscriptionRecord

FieldTypeDescription
transcription_idstring
organization_idstring
modestring
statusobject
attemptsinteger
max_attemptsinteger
provider_requestedstring
provider_usedstring
transcriptstring
confidencenumber
languagestring
duration_secondsnumber
segmentsarraysegment-level timestamps when the provider supplies them (Whisper verbose_json); null/absent for providers that don't emit segments (Deepgram, Gemini)
last_errorstring
created_atstring
updated_atstring
deduplicatedbooleanpresent on idempotent replay

TranscriptSegment

FieldTypeDescription
idinteger
startnumbersegment start time in seconds
endnumbersegment end time in seconds
textstring

TranscriptionStatus

Health

FieldTypeDescription
statusstring
dbboolean
providersarray
default_orgstring

Error

FieldTypeDescription
errorstring

Generated by scripts/gen-capability-docs.py from contracts/stt/v1/openapi.yaml — the contract IS the source of truth; edit the contract, not this page.