Speko Docs

@spekoai/ai-sdk-provider

Speko provider for the Vercel AI SDK — routed speech and transcription.

@spekoai/ai-sdk-provider plugs Speko into the Vercel AI SDK as a speech and transcription provider. One provider entry replaces per-vendor voice code, and Speko's router picks the upstream provider per request.

Install

npm install @spekoai/ai-sdk-provider ai

Setup

Get a key at platform.speko.ai and set SPEKO_API_KEY. The default instance reads it from the environment:

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

To pass the key explicitly, or point at another base URL:

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

const speko = createSpeko({
  apiKey: process.env.SPEKO_API_KEY,
});

First call

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

const { audio } = await generateSpeech({
  model: speko.speech('auto'),
  text: 'Welcome to Speko.',
});

audio.uint8Array holds WAV bytes. Speko synthesizes raw PCM and this provider wraps it in a WAV container at the routed provider's sample rate.

What it implements

Provider specification v4 — SpeechModelV4 and TranscriptionModelV4 — for ai v7.

languageModel, embeddingModel, and imageModel throw NoSuchModelError. Speko is a voice platform.

Next

On this page