--- id: letta-client version: "1.12.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # letta-client — The official Python library for the letta API License: permissive · Maintenance: active · Downloads: 120.3K/mo ## 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 above — 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 pip install letta-client uv add letta-client 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_current - Install friction: low - Maintenance: active - Downloads: 120.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags letta api client python, rest api client library, async http client, typed api wrapper, letta agent sdk, python api client generator, stainless generated client, rest-api-client, async-support, type-safe [View on SkillFed](https://skillfed.io/packages/letta-client) · [View on PyPI](https://pypi.org/project/letta-client/)