Speko Docs

Transcription

Transcribe audio through transcribe with routed STT providers.

Pass speko.transcription(...) to the AI SDK's transcribe.

import { speko } from '@spekoai/ai-sdk-provider';
import { transcribe } from 'ai';
import { readFile } from 'node:fs/promises';

const result = await transcribe({
  model: speko.transcription('auto'),
  audio: await readFile('call.wav'),
  providerOptions: {
    speko: {
      language: 'es-MX',
      keywords: ['Speko', 'Vercel'],
    },
  },
});

console.log(result.text);

keywords are domain terms forwarded to the routed STT provider, which improves recognition of names and product vocabulary.

Which provider answered

providerMetadata.speko reports what the router did:

console.log(result.providerMetadata.speko);
// { provider: 'deepgram', model: 'nova-3', confidence: 0.93, failoverCount: 0, scoresRunId: '...' }

failoverCount is the number of upstream providers tried before one succeeded.

Segments and duration

InputdurationInSecondssegments
WAV or raw PCMreportedone whole-transcript segment
Other formatsundefinedempty

The one-shot transcription endpoint does not report per-word timing yet, so duration is only available when the input length is deterministic.

Pinning a provider

speko.transcription('auto-quality');   // bias toward accuracy
speko.transcription('deepgram');       // pin routing and failover to one provider

See Routing options for every model id and option.

On this page