Speko Docs

Routing options

Model ids and providerOptions.speko for the AI SDK provider.

The model id selects a routing strategy, not a single model.

Model ids

Model idBehavior
autoRouter default for your organization's routing policy
auto-fastBias toward latency
auto-qualityBias toward accuracy and quality
auto-cheapBias toward cost
deepgramPin routing and failover to one upstream provider
elevenlabs/eleven_multilingual_v2Pin the provider and request a specific upstream model
speko.transcription('auto-quality');
speko.speech('elevenlabs/eleven_multilingual_v2');

providerOptions.speko

OptionApplies toDescription
languagebothBCP-47 tag, for example en or es-MX. Routing is language-aware. Defaults to en
regionbothRegion to rank providers in, for example us-east4 or eu-west1
optimizeForbothbalanced, accuracy, latency, or cost. Overrides the model id preset
providersbothRestrict routing and failover to these upstream providers
keywordstranscriptionDomain keywords forwarded to the routed STT provider
outputFormatspeechwav (default) or pcm for raw s16le mono
modelspeechUpstream model override, for example sonic-2
spokenFormspeechDeterministic spoken-form normalization before synthesis

Failover

Failover happens server-side. If the routed provider errors or degrades, Speko retries against the next-ranked provider before the call returns. A single generateSpeech or transcribe call can therefore cross providers without the caller noticing.

providerMetadata.speko.failoverCount reports how many were tried. Use providers to constrain the pool the router and its failover may draw from.

Unsupported settings

fetch and headers provider settings are not supported. @spekoai/sdk manages its own transport and headers, so custom headers produce an unsupported-setting warning rather than being sent.

On this page