{"id":"anthropic","title":"Anthropic Python SDK","library":"anthropic","description":"Official Python SDK for the Anthropic API providing access to Claude models. Current version is 0.84.0 (Feb 2026). Releases approximately weekly. Two separate packages exist: anthropic (core SDK) and claude-agent-sdk-python (agent workflows).","status":"active","version":"0.84.0","install":[{"cmd":"pip install anthropic","lang":"bash","label":"Python (core SDK)"},{"cmd":"pip install claude-agent-sdk","lang":"bash","label":"Python (agent SDK)"},{"cmd":"npm install @anthropic-ai/sdk","lang":"bash","label":"Node.js"}],"dependencies":[{"package":"claude-agent-sdk","reason":"Required for multi-agent workflows with Claude. Separate from core anthropic package.","optional":true},{"package":"anthropic[bedrock]","reason":"Required for AWS Bedrock access.","optional":true},{"package":"anthropic[vertex]","reason":"Required for Google Vertex AI access.","optional":true}],"imports":[{"symbol":"Anthropic","correct":"from anthropic import Anthropic","wrong":"import anthropic; anthropic.Client(api_key=...)","note":"anthropic.Client is the old pre-0.3 API. Removed. Always use Anthropic() class."},{"symbol":"AsyncAnthropic","correct":"from anthropic import AsyncAnthropic","wrong":"import anthropic; anthropic.AsyncClient()","note":"Use AsyncAnthropic for async contexts, not the legacy async client."}],"quickstart":{"code":"from anthropic import Anthropic\n\nclient = Anthropic()  # reads ANTHROPIC_API_KEY from env\nmessage = client.messages.create(\n    model='claude-opus-4-6',\n    max_tokens=1024,\n    messages=[\n        {\"role\": \"user\", \"content\": \"Hello, Claude\"}\n    ]\n)\nprint(message.content[0].text)","lang":"python","description":"Minimal message call using the Anthropic SDK 0.84.x."},"warnings":[{"severity":"breaking","message":"anthropic.Client() is removed. Use anthropic.Anthropic() instead.","affected_versions":"< 0.3.0","fix":"client = Anthropic(api_key=os.environ.get('ANTHROPIC_API_KEY'))"},{"severity":"gotcha","message":"SDK releases weekly. Pin your version in production or expect frequent behaviour changes.","affected_versions":"all","fix":"Pin with anthropic==0.84.0 in requirements.txt"},{"severity":"gotcha","message":"message.content is a list, not a string. Access text via message.content[0].text.","affected_versions":"all","fix":"print(message.content[0].text) not print(message.content)"},{"severity":"gotcha","message":"max_tokens is required. No default value. Omitting raises a validation error.","affected_versions":"all","fix":"Always pass max_tokens=1024 or appropriate value"},{"severity":"deprecated","message":"claude-agent-sdk-python no longer requires Claude Code to be installed separately. It is bundled.","affected_versions":"all","fix":"Remove any separate Claude Code install steps from your setup."}],"last_verified":"2026-02-28","next_check":"2026-03-28","source_url":"https://github.com/anthropics/anthropic-sdk-python","language":"en","source_language":"en","tags":["anthropic","claude","llm","agents","python","nodejs"]}