The Letta API
The Letta platform provides multiple ways to interact with your stateful agents. Whether through the ADE’s visual interface or programmatically via our APIs, you’re always connecting to the same agents running in your Letta server.
flowchart TB
subgraph server["Letta Server
Letta Cloud or Self-Hosted"]
end
server --> ade["ADE"]
server --> python["Python SDK"]
server --> ts["TypeScript SDK"]
server --> rest["REST API"]
class ade,python,ts,rest interface
APIs and SDKs
Section titled “APIs and SDKs”We provide a comprehensive REST API and native SDKs in Python and TypeScript. All three interfaces - the ADE, REST API, and SDKs - use the same underlying API to interact with your agents, making it seamless to develop visually in the ADE and then integrate those agents into your applications.
Python SDK
Section titled “Python SDK”The Letta Python SDK can be downloaded with:
pip install letta-clientOnce installed, you can instantiate the client in your Python code with:
from letta_client import Letta
# connect to a local serverclient = Letta(base_url="http://localhost:8283")
# connect to Letta Cloudclient = Letta( token="LETTA_API_KEY", project="default-project",)TypeScript SDK
Section titled “TypeScript SDK”The Letta TypeScript (Node) SDK can be downloaded with:
npm install @letta-ai/letta-clientOnce installed, you can instantiate the client in your TypeScript code with:
import { LettaClient } from "@letta-ai/letta-client";
// connect to a local serverconst client = new LettaClient({ baseUrl: "http://localhost:8283",});
// connect to Letta Cloudconst client = new LettaClient({ token: "LETTA_API_KEY", project: "default-project",});