Client SDKs
Official Python and TypeScript SDKs for the Letta API.
Letta provides official SDKs for Python and TypeScript that simplify API integration.
Installation
Section titled “Installation”Python:
pip install letta-clientTypeScript:
npm install @letta-ai/letta-clientBenefits
Section titled “Benefits”- Automatic header management
- Type-safe request and response handling
- Built-in retry logic and error handling
- Streaming support
Python SDK
Section titled “Python SDK”from letta_client import Letta
client = Letta(api_key="your-api-key")
# Create an agentagent = client.agents.create( model="openai/gpt-4.1", embedding="openai/text-embedding-3-small",)
# Send a messageresponse = client.agents.messages.create( agent_id=agent.id, input="Hello!")TypeScript SDK
Section titled “TypeScript SDK”import Letta from "@letta-ai/letta-client";
const client = new Letta({ apiKey: "your-api-key" });
// Create an agentconst agent = await client.agents.create({ model: "openai/gpt-4.1", embedding: "openai/text-embedding-3-small",});
// Send a messageconst response = await client.agents.messages.create(agent.id, { input: "Hello!",});