Skip to content
  • Auto
  • Light
  • Dark
DiscordForumGitHubSign up

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

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.

The Letta Python SDK can be downloaded with:

Terminal window
pip install letta-client

Once installed, you can instantiate the client in your Python code with:

from letta_client import Letta
# connect to a local server
client = Letta(base_url="http://localhost:8283")
# connect to Letta Cloud
client = Letta(
token="LETTA_API_KEY",
project="default-project",
)

The Letta TypeScript (Node) SDK can be downloaded with:

Terminal window
npm install @letta-ai/letta-client

Once installed, you can instantiate the client in your TypeScript code with:

import { LettaClient } from "@letta-ai/letta-client";
// connect to a local server
const client = new LettaClient({
baseUrl: "http://localhost:8283",
});
// connect to Letta Cloud
const client = new LettaClient({
token: "LETTA_API_KEY",
project: "default-project",
});