letta-client
The official Python library for the letta API
What it is and what it does
Letta-client is the official Python SDK for the Letta REST API, generated using Stainless. It wraps HTTP communication with full type safety via Pydantic models and TypedDicts, offering both synchronous and asynchronous clients powered by httpx. The library handles pagination automatically, supports streaming responses via Server-Side Events, and provides structured error handling with specific exception types for different HTTP status codes.
You use it to build Python applications that interact with Letta agents and archives. The client manages authentication via API keys, serialization and deserialization of requests and responses, and offers optional aiohttp support for improved async concurrency. It supports Python 3.9 through 3.14 and is cross-platform (macOS, Windows, Linux).
Use it for:
- Build a chatbot or conversational agent application that delegates message handling to Letta's managed agent infrastructure.
- Automate archive management (creation, querying, updates) as part of a larger data pipeline or knowledge management system.
- Develop an async service that streams agent responses in real-time to multiple concurrent clients using the AsyncLetta client.
- Integrate Letta agent capabilities into an existing Python web framework by using the typed client for type-checked API calls.
- Paginate through large lists of agents or archives without manually handling page cursors or making repeated requests.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a Python client library for the Letta REST API with type-safe request and response handling, supporting both synchronous and asynchronous operations.
Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive license, and provides a clean, type-safe interface to the Letta API. Install it if you need to programmatically interact with Letta agents or archives from Python. The low install friction and support for both sync and async patterns make it suitable for most Python projects.
Install
letta-client on PyPI
pip
pip install letta-clientuv
uv add letta-clientpoetry
poetry add letta-clientInstalling letta-client
Before you install
Low friction install with six common runtime dependencies. The package is actively maintained with a recent release (73 days ago) and no known vulnerabilities.
License in practice
Apache-2.0 permissive license allows use in most commercial and open-source projects without significant restrictions.
Quickstart
pip install letta-client
import os
from letta_client import Letta
client = Letta(
api_key=os.environ.get("LETTA_API_KEY"),
environment="local",
)
archive = client.archives.create(name="name")
print(archive.id)
Requires Python 3.9 or later; LETTA_API_KEY environment variable or explicit api_key parameter needed for authentication.
Verify before relying
- Whether the Letta service itself (not just this client) is production-ready and suitable for your use case.
- Performance characteristics and rate limits of the underlying Letta REST API.
- Whether aiohttp backend (optional dependency) provides measurable concurrency improvements for your workload.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — anyio, distro, httpx, pydantic, sniffio, typing-extensions |
| Maintenance | actively maintained — 73 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 120,263/month — #12,039 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: letta_client-1.12.1-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
agentex-clientProvides a typed Python REST client for the…
permissive · top 15,000 on PyPI
lettaLetta is a framework for building LLM agents…
permissive · top 15,000 on PyPI
opencode-aiProvides a Python client library for the…
permissive · top 15,000 on PyPI
composio-clientA Python client library for the Composio REST…
permissive · top 5,000 on PyPI
modern-treasuryProvides a typed Python client library for the…
permissive · top 15,000 on PyPI
groqProvides a Python client library for accessing…
permissive · top 1,000 on PyPI
sambanovaProvides a Python client library for accessing…
permissive · top 15,000 on PyPI
llama-api-clientProvides a typed Python client for the Llama…
permissive · top 15,000 on PyPI
knockapiProvides a typed Python client library for the…
permissive · top 5,000 on PyPI
bilibili-api-pythonProvides async Python bindings for Bilibili's…
copyleft · top 15,000 on PyPI