Voice Agents

Voice agents support is experimental and may be unstable. For more information, visit our Discord.

All Letta agents can be connected to a voice provider by using the OpenAI-compatible streaming chat completions endpoint at https://api.letta.com/v1/chat/completions. Any standard Letta agent can be used for voice applications.

The legacy /v1/voice-beta/<AGENT_ID> endpoint has been deprecated. Please use the OpenAI-compatible /v1/chat/completions endpoint with stream=true for voice applications.

Creating a voice agent

You can create a voice agent using the standard Letta agent creation flow:

1from letta_client import Letta
2import os
3
4client = Letta(token=os.getenv('LETTA_API_KEY'))
5
6# create the Letta agent
7agent = client.agents.create(
8 memory_blocks=[
9 {"value": "Name: ?", "label": "human"},
10 {"value": "You are a helpful assistant.", "label": "persona"},
11 ],
12 model="openai/gpt-4o-mini" # Use 4o-mini for speed
13)

You can attach additional tools and blocks to this agent just as you would any other Letta agent.