On this page

Install

Add VoiceAI SDK to a Node or Bun project, and the vendor SDK for the three providers that need one.

VoiceAI SDK is one package. Every provider adapter ships inside it under its own subpath, so voiceai-sdk/deepgram and voiceai-sdk/elevenlabs need nothing else installed.

Install the package

npm install voiceai-sdk

The package is ESM only and needs Node 22 or later, or Bun. The examples in these docs use await using, which Node runs natively from Node 24. On Node 22, run them with npx tsx.

Provider packages

Most adapters call the provider's HTTP or WebSocket API directly. Three wrap the vendor's own SDK, which you install next to voiceai-sdk:

ProviderExtra packageCredentials
Google Cloud@google-cloud/speech, @google-cloud/text-to-speechGOOGLE_APPLICATION_CREDENTIALS
Azure Speechmicrosoft-cognitiveservices-speech-sdkAZURE_SPEECH_KEY, AZURE_SPEECH_REGION
AWS@aws-sdk/client-transcribe-streaming, @aws-sdk/client-pollyAWS credentials, AWS_REGION
LocalNone. Needs whisper-cli and piper on PATHNone
Every other providerNoneOne API key, such as DEEPGRAM_API_KEY

For example, to use Azure Speech:

npm install voiceai-sdk microsoft-cognitiveservices-speech-sdk

Set your keys

Each adapter reads its key from the environment, or from the options you pass to its factory. Keep keys on the server. A browser bundle that imports a provider adapter would ship the key to every visitor.

Bash
# .env
DEEPGRAM_API_KEY=dg_...
ELEVENLABS_API_KEY=sk_...

Check your setup

doctor checks your Node version, which provider keys it can see, and whether the local binaries are installed.

Bash
npx voiceai-sdk doctor

It prints one line per provider and exits non-zero if a provider you configured can't connect.

Next steps

Was this page helpful?

Esc

Loading…

↑↓ navigate openCtrl J preview