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. Example: {"keywords":["Speko","Ava Martinez"]}.

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"
}