Skip to content
Letta Platform Letta Platform Letta Docs
Sign up
Using the API

Client SDKs

Download the Python and TypeScript SDKs for the Letta API

Letta provides official SDKs for Python and TypeScript that simplify API integration. All API endpoints are also available directly via REST.

We highly recommend developers building on the Letta API use the client SDKs, which provide:

  • Automatic header management
  • Type-safe request and response handling
  • Built-in retry logic and error handling

Python:

Terminal window
pip install letta-client

TypeScript:

Terminal window
npm install @letta-ai/letta-client
from letta_client import Letta
client = Letta(api_key="your-api-key")
# Create an agent
agent = client.agents.create(
model="openai/gpt-4.1",
embedding="openai/text-embedding-3-small",
)
# Send a message
response = client.agents.messages.create(
agent_id=agent.id,
input="Hello!"
)
import Letta from "@letta-ai/letta-client";
const client = new Letta({ apiKey: "your-api-key" });
// Create an agent
const agent = await client.agents.create({
model: "openai/gpt-4.1",
embedding: "openai/text-embedding-3-small",
});
// Send a message
const response = await client.agents.messages.create(agent.id, {
input: "Hello!",
});