skillfed

letta-client

The official Python library for the letta API

letta-client v1.12.1 120.3K downloads/30d#12,039 on PyPI55
Permissive license Apache-2.0 Active released

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-client

uv

uv add letta-client

poetry

poetry add letta-client

Installing 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

Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

letta api client pythonrest api client libraryasync http clienttyped api wrapperletta agent sdkpython api client generatorstainless generated client
rest-api-clientasync-supporttype-safe

More Python Modules packages