{"id":23961,"library":"letta-client","title":"Letta Python Client","description":"The official Python library for the Letta API, providing a typed interface to agents, conversations, messages, tools, and more. Current version 1.10.3, requires Python >=3.9, actively maintained with frequent releases (multiple per month).","status":"active","version":"1.10.3","language":"python","source_language":"en","source_url":"https://github.com/letta-ai/letta-python","tags":["letta","api-client","agent","conversation","ai"],"install":[{"cmd":"pip install letta-client","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used for extended type hints; minimum version required (>=4.7)","package":"typing-extensions","optional":false}],"imports":[{"note":"Direct module import does not expose the client; use named import.","wrong":"import letta","symbol":"Letta","correct":"from letta import Letta"}],"quickstart":{"code":"import os\nfrom letta import Letta\n\nclient = Letta(api_key=os.environ.get('LETTA_API_KEY', ''))\nagents = client.agents.list()\nprint(agents)","lang":"python","description":"Initialize the Letta client and list all agents."},"warnings":[{"fix":"Use keyword arguments: `Letta(api_key='...')`. For environment variable, omit api_key entirely.","message":"The client constructor changed from positional to keyword-only arguments in v1.x. Use `Letta(api_key=...)` instead of `Letta('...')`.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Always use the exact model string as returned by `client.models.list()`.","message":"Methods that accept `model` or `model_id` may be case-sensitive. Use exact model identifiers from the Letta dashboard.","severity":"gotcha","affected_versions":"all"},{"fix":"Add `stream=True` to create calls: `client.messages.create(..., stream=True)`.","message":"Streaming responses require `stream=True` parameter in message creation endpoints. Without it, the response is non-streaming and may hang if large.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install with `pip install letta-client` then import with `from letta import Letta`.","cause":"Typo in package name: installed `letta-client` but imported as `letta`.","error":"ModuleNotFoundError: No module named 'letta'"},{"fix":"Upgrade to latest: `pip install --upgrade letta-client` and use `from letta import Letta`.","cause":"Outdated version or incorrect import path. The SDK was previously structured differently.","error":"ImportError: cannot import name 'Letta' from 'letta'"},{"fix":"Set the `LETTA_API_KEY` environment variable or pass `api_key` to the Letta constructor.","cause":"Missing or invalid API key. The client cannot reach the Letta API.","error":"letta.APIConnectionError: Connection error"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}