Give your agent a voice.
Add real-time voice to your app with one import. Transcripts, voices, and audio across 12 cloud providers, Whisper, Piper, and Mock.
Install
bun add voiceai-sdkOne package, every adapter included
Create
await using call = await createSession(openai())Closed when the scope exits
Speak
await call.say`How can I help?`Speech and transcripts on one session
Local, cloud, or in-memory.
Develop on your machine with Whisper and Piper, test with scripted audio, ship to OpenAI, Deepgram, ElevenLabs, Cartesia, AssemblyAI and more. The API stays the same. See how they benchmark.
Swap the adapter, keep the code.
Every adapter passes the same conformance suite. Moving providers is an import change, not a rewrite.
Transcribe speech
Streaming speech-to-text with partial and final transcripts, word timings and timeouts. Silence comes back as ok: false, not a throw.
Speak in any voice
Stream text-to-speech in the voices your provider offers. Audio starts playing before the reply is finished.
Control the conversation
Connect, reconnect by id, let callers interrupt, pause or end a session. Each adapter declares what it supports.
Tests run in-process.
mock() keeps the voice session inside your test process. No microphone, no network, nothing to pay for.
- The same API as the cloud adapters
- No API key and no network in CI
- Scripted audio, transcripts and voices, all in memory