Speko Docs
API Reference

Transcribe

Routes the request to the best STT provider for your `(language, region, optimizeFor)` intent, with automatic failover to runner-up providers. Body is binary audio. Routing intent goes in the `x-speko-intent` header (JSON).

POST
/v1/transcribe

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Header Parameters

x-speko-intent*string

JSON-encoded RoutingIntent. Example: {"language":"en-US","region":"global"}.

x-speko-constraints?string

Optional JSON-encoded PipelineConstraints. Each allowedProviders entry is either "<vendor>" (any model from that vendor) or "<vendor>:<model>" (a specific model). Example: {"allowedProviders":{"stt":["deepgram:nova-3"]}}.

x-speko-stt-options?string

Optional JSON-encoded STT options, max 4 KB. Fields: keywords (string[], <=200, vocabulary bias), language (BCP-47 or auto, provider-level override that does not change routing), workload (conversation | transcription | narration, applies registry defaults per provider), diarization (batch-only boolean, demote-class: incapable providers are excluded from failover; 422 no_capable_provider when none remain), speakersExpected (integer hint), smartFormat (boolean), fillerWords (boolean), profanityFilter (boolean), providerOptions (per-provider params validated against the registry, e.g. {"deepgram":{"dictation":true}}; apply only when that provider serves the request and never cross providers on failover). Example: {"workload":"transcription","diarization":true}.

Content-Type?string

Audio MIME type, e.g. audio/wav, audio/mpeg, audio/pcm;rate=16000.

Request Body

Binary audio. WAV, MP3, or raw PCM accepted.

TypeScript Definitions

Use the request body type in TypeScript.

body*file
Formatbinary

Response Body

text/event-stream

application/json

application/json

application/json

"string"
{
  "error": "Audio body is empty.",
  "code": "INVALID_AUDIO"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
{
  "error": "All providers failed",
  "code": "TRANSCRIBE_FAILED"
}