Reference

SDKs

Pick the right package for your stack, from a typed REST client to a full voice agent.

VoiceLayer ships SDKs for TypeScript and Python, and every call works with plain curl too. Each SDK is generated from the same OpenAPI document as the API reference, so it covers every operation with typed requests, responses and errors.

Client libraries

Use a client library when your own code sends and receives messages.

TypeScriptPython
Package@voicelayer/apivoicelayer
RuntimeNode.js 18 or laterPython 3.9 or later
Webhook checkverifyWebhookverify_webhook
Event streamstreamEventsstream_events
GuideTypeScript SDKPython SDK

TypeScript:

npm install @voicelayer/api

Python:

Once published
pip install voicelayer

Publishing soon

Publishing soon: voicelayer is not on PyPI yet. Until it is, install it from a checkout of the VoiceLayer repository (sdks/python/voicelayer), as shown.
Until then: from a checkout of the repository
pip install ./voicelayer/sdks/python/voicelayer

Both clients ignore fields and enum values they do not know yet, so a new event type or error code never breaks an older client.

Framework packages

Use a framework package when an AI agent framework should talk on your channels. Each one gives the framework the VoiceLayer channel tools over MCP, and can also answer incoming messages with your agent.

Answer messages from your code

@voicelayer/sdk/direct runs a handler for every message in the conversations your code controls. You write onMessage; the runner reads the event stream, resumes after restarts, and sends your replies safely. See Direct mode.

Voice agents

@voicelayer/sdk defines a voice agent in one TypeScript file: its prompt, models, tools and hooks. VoiceLayer runs the call; your worker runs your code. See Voice agents in code.

npm install @voicelayer/sdk

Next steps

On this page