npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@spekoai/ai-sdk-provider

v0.1.0

Published

Speko provider for the Vercel AI SDK - routed speech and transcription across every voice provider

Readme

@spekoai/ai-sdk-provider

Speko provider for the Vercel AI SDK - routed speech and transcription across every voice provider.

Speko is an OpenRouter-style routing layer for the voice stack (TTS + STT). One API key, one provider entry in your AI SDK code, and Speko's benchmark-driven router picks the best upstream provider (ElevenLabs, Cartesia, Deepgram, AssemblyAI, OpenAI, and more) per request - and fails over automatically when a provider degrades.

Implements the AI SDK provider specification v4 (SpeechModelV4 + TranscriptionModelV4), for ai v7.

Install

npm install @spekoai/ai-sdk-provider ai

Setup

Get an API key at platform.speko.dev and set it as SPEKO_API_KEY, or pass it explicitly:

import { createSpeko } from '@spekoai/ai-sdk-provider';

const speko = createSpeko({
  apiKey: process.env.SPEKO_API_KEY,
  // baseURL: 'https://api.speko.dev',
});

The default instance reads SPEKO_API_KEY from the environment:

import { speko } from '@spekoai/ai-sdk-provider';

Speech

import { speko } from '@spekoai/ai-sdk-provider';
import { generateSpeech } from 'ai';

const { audio } = await generateSpeech({
  model: speko.speech('auto'),
  text: 'Welcome to Speko.',
  voice: 'QtY3JBOUKEB5xzrRfOKc', // optional, provider-specific
  providerOptions: {
    speko: { language: 'en', optimizeFor: 'latency' },
  },
});

// audio.uint8Array - WAV bytes (Speko synthesizes raw PCM; this provider
// wraps it into a WAV container at the routed provider's sample rate).

Pass outputFormat: 'pcm' to receive the raw s16le mono PCM instead of WAV. The sample rate is reported in providerMetadata.speko.sampleRate.

Transcription

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);
console.log(result.providerMetadata.speko);
// { provider: 'deepgram', model: 'nova-3', confidence: 0.93, failoverCount: 0, scoresRunId: '...' }

Model ids

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

| Model id | Behavior | | --- | --- | | auto | Router default for your organization's routing policy | | auto-fast | Bias toward latency | | auto-quality | Bias toward accuracy/quality | | auto-cheap | Bias toward cost | | deepgram | Pin routing and failover to one upstream provider | | elevenlabs/eleven_multilingual_v2 | Pin the provider and request a specific upstream model |

speko.transcription('auto-quality');
speko.speech('elevenlabs/eleven_multilingual_v2');

Routing options (providerOptions.speko)

This is where Speko differs from single-vendor providers: the options control the router, not one model.

| Option | Applies to | Description | | --- | --- | --- | | language | both | BCP-47 language tag, e.g. en, es-MX. Routing is language-aware. Defaults to en | | region | both | Region to rank providers in, e.g. us-east4, eu-west1 | | optimizeFor | both | balanced | accuracy | latency | cost; overrides the model id preset | | providers | both | Restrict routing AND failover to these upstream providers | | keywords | transcription | Domain keywords forwarded to the routed STT provider | | model | speech | Upstream model override, e.g. sonic-2 | | spokenForm | speech | Deterministic spoken-form normalization before synthesis |

Failover

Failover is handled server-side by Speko: if the routed provider errors or degrades, the request is retried against the next-ranked provider before the call returns. The number of failovers taken is reported in providerMetadata.speko.failoverCount. Use providers to control the pool the router (and its failover) may use.

Notes

  • The one-shot transcription endpoint does not report per-word timing yet: when the input duration is deterministic (WAV or raw PCM input) the provider reports durationInSeconds and a single whole-transcript segment; otherwise segments is empty and durationInSeconds is undefined.
  • languageModel, embeddingModel, and imageModel throw NoSuchModelError - Speko is a voice platform.

Links

License

MIT