---
title: API overview | Letta Docs
description: How to access the Letta API (REST endpoints and authentication)
---

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

**New to the Letta API?** If you’re building a computer use agent (that can write code, run local files, etc), consider using the [**Letta Code SDK**](/letta-code-sdk/quickstart/index.md), which supports local tool execution and comes with pre-built computer use tools (`Bash`, `Grep`, etc), all out-of-the-box.

## Prerequisites

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

For step-by-step setup instructions, see the [API quickstart](/guides/build-with-letta/quickstart/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.

## Client SDKs

Letta provides official SDKs for Python and TypeScript that simplify API integration, providing:

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

### Python

Terminal window

```
pip install letta-client
```

```
from letta_client import Letta


client = Letta(api_key="your-api-key")


agent = client.agents.create(
    model="openai/gpt-4.1",
)


response = client.agents.messages.create(
    agent_id=agent.id,
    input="Hello!"
)
```

### TypeScript

Terminal window

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

```
import Letta from "@letta-ai/letta-client";


const client = new Letta({ apiKey: "your-api-key" });


const agent = await client.agents.create({
  model: "openai/gpt-4.1",
});


const response = await client.agents.messages.create(agent.id, {
  input: "Hello!",
});
```

## Next steps

[Quickstart ](/guides/build-with-letta/quickstart/index.md)Prerequisites, step-by-step tutorial, and examples.

[Core concepts ](/guides/core-concepts/stateful-agents/index.md)Understand agents, memory blocks, and tools.
