@speechify/vercel
v0.3.0
Published
SpeechifyAI text-to-speech provider for the Vercel AI SDK
Downloads
417
Readme
SpeechifyAI provider for the Vercel AI SDK
The SpeechifyAI provider for the Vercel AI SDK adds SpeechifyAI's text-to-speech models to the AI SDK's unified speech interface — switch from OpenAI, ElevenLabs, or Deepgram to SpeechifyAI with a one-line model swap. It is a thin bridge over the official @speechify/api client.
Setup
npm install @speechify/vercel aiGet an API key from the SpeechifyAI Platform and set it as SPEECHIFY_API_KEY.
Usage
import { speechify } from '@speechify/vercel';
import { generateSpeech } from 'ai';
const { audio } = await generateSpeech({
model: speechify.speech(), // simba-3.2, voice "geffen_32"
text: 'Hello from Speechify!',
});To customize the API key, base URL, or headers, create your own provider instance:
import { createSpeechify } from '@speechify/vercel';
const speechify = createSpeechify({
apiKey: process.env.MY_SPEECHIFY_KEY,
});Models
| Model ID | Description |
| --- | --- |
| simba-3.2 | Latest-generation streaming-native model, lower latency and richer expressivity (default). English only; serves a curated voice set. |
| simba-english | English-optimized TTS |
| simba-multilingual | Multilingual TTS — use this for non-English input |
| simba-3.0 | Earlier Simba 3 model, still available |
Voices
The voice option takes a SpeechifyAI voice ID, including your own cloned voices. Defaults to geffen_32 when omitted. The simba-3.2 curated set is currently: beatrice_32, dominic_32, edmund_32, geffen_32, harper_32, hugh_32, imogen_32, wyatt_32; voices like george and scott work with the 1.6 models. List available voices with GET /v1/voices (docs) — each voice's models field shows which models it supports; simba-3.2 serves a curated subset of shared voices (cloned voices are not in it).
Output formats
The standard outputFormat option accepts either a simple format name — mp3, wav, ogg, aac, pcm — or a SpeechifyAI codec string with sample rate and bitrate, e.g. mp3_24000_128, pcm_16000, ulaw_8000 (useful for telephony). Defaults to mp3 when omitted.
Speed, emotion, and SSML
SpeechifyAI controls prosody through SSML. The standard speed option is implemented by wrapping your text in <speak><prosody rate="...">:
await generateSpeech({
model: speechify.speech(),
text: 'A bit faster please.',
speed: 1.25,
});If your text is already SSML (starts with <speak), it is sent unchanged — set rate, pitch, and emotion directly in your markup. The instructions option is not supported and produces a warning.
Provider options
await generateSpeech({
model: speechify.speech(),
text: 'Hello!',
providerOptions: {
speechify: {
ssml: true, // treat text as SSML, disable speed wrapping
outputFormat: 'mp3_24000_128', // codec string, overrides outputFormat
loudnessNormalization: true,
textNormalization: true,
},
},
});Speech marks (word timing)
SpeechifyAI returns word- and sentence-level timing data with every generation, available via provider metadata:
const result = await generateSpeech({
model: speechify.speech(),
text: 'Timed speech.',
});
const { speechMarks, billableCharactersCount } =
result.providerMetadata.speechify;Limitations
- Text-to-speech only — SpeechifyAI has no transcription API, so there is no transcription model.
- The AI SDK speech interface is request/response; SpeechifyAI's streaming endpoint (
/v1/audio/stream) is not yet exposed through this provider.
