---
title: Client SDKs | Letta Docs
description: Use the Python and TypeScript SDKs for the Letta API
---

The Letta API is a RESTful API at `https://api.letta.com` that provides programmatic access to stateful agents with persistent memory.

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

If you’re building a computer use agent that can write code, run local files, and use local tools, consider using the [**Agent SDK**](/letta-agent-sdk/quickstart/index.md), which builds on top of the core client SDK and adds rich support for local tool execution.

## Prerequisites

To use the Letta API, you’ll need an [API key](https://app.letta.com).

For a step-by-step V1 SDK tutorial, see the [V1 SDK overview](/guides/get-started/intro/index.md).

## Authentication

All requests to the Letta API must include these headers:

| Header          | Value                   | Required |
| --------------- | ----------------------- | -------- |
| `Authorization` | `Bearer <your-api-key>` | Yes      |
| `Content-Type`  | `application/json`      | Yes      |

If you are using the client SDKs, the SDK will send these headers automatically.

## Why use the SDKs?

We 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

## Installation

**Python:**

Terminal window

```
pip install letta-client
```

**TypeScript:**

Terminal window

```
npm install @letta-ai/letta-client
```

## Python SDK

```
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!"
)
```

## TypeScript SDK

```
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!",
});
```

## Resources

- [Python SDK on GitHub](https://github.com/letta-ai/letta-python)
- [TypeScript SDK on GitHub](https://github.com/letta-ai/letta-node)
- [Python SDK on PyPI](https://pypi.org/project/letta-client/)
- [TypeScript SDK on npm](https://www.npmjs.com/package/@letta-ai/letta-client)
