Concept

Bring your agent

Put the agent you built with the Claude Agent SDK, the OpenAI Agents SDK, the Vercel AI SDK or LangChain on VoiceLayer's calls and text channels.

You already have an agent. VoiceLayer gives it a phone number, SMS, WhatsApp, Telegram, Discord and email, and keeps everything that is hard to run: speech, telephony, delivery, and the guard that checks what goes out. You keep the agent: its prompt, its model, its tools and its framework.

There are three ways to connect it. They are separate on purpose, and you can use any mix of them.

Answer callsAnswer textsUse channels as tools
What it doesYour agent is the brain of a VoiceLayer voice agent. The caller talks to VoiceLayer's voice; your agent writes each reply.Your process answers every incoming message in the conversations your code controls.Your agent sends, replies and reads messages by calling VoiceLayer's tools.
ChannelsPhone callsSMS, WhatsApp, Telegram, Discord, emailThe same, as tools; the API key decides which
What you writedefineAgent({ brain }) with an adapter: openaiBrain(agent), claudeBrain(options), aiSdkBrain(agent) or langchainBrain(graph)serveDirect(agent) (for Claude, its options)voicelayerMcpServer(), voicelayerMcp() or voicelayerTools(), depending on the framework
Package@voicelayer/sdk and @voicelayer/agents@voicelayer/agents@voicelayer/agents
You keepThe agent loop, the model and its key, the worker process that runs itThe agent loop, the model and its key, the process that runs itEverything: the agent decides when to use a tool
VoiceLayer keepsSpeech to text, text to speech, turn-taking, telephony, the transcript, and a guard on what your agent says and doesThe channels, delivery, the event stream, and the same checks on every reply as on any send, the output guard includedThe channels, the API key's scopes, and the same checks as any API call

What works with which framework

The adapter for each framework ships in @voicelayer/agents. This is what exists today:

FrameworkCallsTextsTools
Claude Agent SDKclaudeBrain(options)serveDirect(options)voicelayerMcp()
OpenAI Agents SDKopenaiBrain(agent)serveDirect(agent)voicelayerMcpServer()
Vercel AI SDKaiSdkBrain(agent)serveDirect(agent)voicelayerTools()
LangChain and LangGraphlangchainBrain(graph)serveDirect(graph)voicelayerTools()

Every brain adapter works the same way for the caller. They differ in how your agent gets VoiceLayer's call controls (transfer, hang up, keypad digits): the OpenAI adapter adds them to your agent for you, and the other three give them to a function you write. Each framework page says which.

The Vercel AI SDK adapter is in @voicelayer/agents only. The lower-level @voicelayer/sdk has adapters for the OpenAI Agents SDK, the Claude Agent SDK and LangGraph, but none for the AI SDK. The Python package, voicelayer-agents, covers texts and tools for Claude, OpenAI Agents and LangGraph. It has no call adapter: see Python frameworks.

Answering calls and texts with the same agent

You can share one agent between both modes today. Write the agent once in a module, then import it from two small files: one is your voice agent (defineAgent({ brain })), the other calls serveDirect. Each framework page ends with this pattern.

Not yet: a single process, started once, that answers calls and texts from one object. A call reaches your brain, but a text does not: VoiceLayer's text channels cannot send a turn to a brain yet. That needs the text engine to run without a call room, which is not released. Until then you run two processes, one for calls and one for texts. They share the agent's code and prompt, not a running agent: each process keeps its own state.

Pick your framework

Not using a framework

Next steps

On this page