{"id":2,"library":"anthropic","title":"Anthropic Python SDK","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","language":"python","source_language":"en","source_url":"https://github.com/anthropics/anthropic-sdk-python","tags":["anthropic","claude","llm","agents","python","nodejs"],"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":[{"reason":"Required for multi-agent workflows with Claude. Separate from core anthropic package.","package":"claude-agent-sdk","optional":true},{"reason":"Required for AWS Bedrock access.","package":"anthropic[bedrock]","optional":true},{"reason":"Required for Google Vertex AI access.","package":"anthropic[vertex]","optional":true}],"imports":[{"note":"anthropic.Client is the old pre-0.3 API. Removed. Always use Anthropic() class.","wrong":"import anthropic; anthropic.Client(api_key=...)","symbol":"Anthropic","correct":"from anthropic import Anthropic"},{"note":"Use AsyncAnthropic for async contexts, not the legacy async client.","wrong":"import anthropic; anthropic.AsyncClient()","symbol":"AsyncAnthropic","correct":"from anthropic import AsyncAnthropic"}],"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":[{"fix":"client = Anthropic(api_key=os.environ.get('ANTHROPIC_API_KEY'))","message":"anthropic.Client() is removed. Use anthropic.Anthropic() instead.","severity":"breaking","affected_versions":"< 0.3.0"},{"fix":"Pin with anthropic==0.84.0 in requirements.txt","message":"SDK releases weekly. Pin your version in production or expect frequent behaviour changes.","severity":"gotcha","affected_versions":"all"},{"fix":"print(message.content[0].text) not print(message.content)","message":"message.content is a list, not a string. Access text via message.content[0].text.","severity":"gotcha","affected_versions":"all"},{"fix":"Always pass max_tokens=1024 or appropriate value","message":"max_tokens is required. No default value. Omitting raises a validation error.","severity":"gotcha","affected_versions":"all"},{"fix":"Remove any separate Claude Code install steps from your setup.","message":"claude-agent-sdk-python no longer requires Claude Code to be installed separately. It is bundled.","severity":"deprecated","affected_versions":"all"},{"fix":"Replace `claude-agent-sdk` with `anthropic` or `claude-agent-sdk-python` in your requirements/install commands.","message":"The package `claude-agent-sdk` is not a valid PyPI package and cannot be found. If you are trying to install the main Anthropic SDK, use `anthropic`. If you are looking for an agent-specific SDK, you might be looking for `claude-agent-sdk-python`.","severity":"breaking","affected_versions":"all"},{"fix":"client = Anthropic(api_key=os.environ.get('ANTHROPIC_API_KEY'))","message":"Failed to authenticate due to missing API key. Ensure `api_key` is passed during client initialization or set the `ANTHROPIC_API_KEY` environment variable.","severity":"breaking","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.84.0':19 '2026':21 'access':12 'agent':35,38,43 'anthrop':1,9,29,40 'api':10 'approxim':23 'claud':14,34,41 'claude-agent-sdk-python':33 'core':30 'current':16 'exist':28 'feb':20 'llm':42 'model':15 'nodej':45 'offici':4 'packag':27 'provid':11 'python':2,5,37,44 'releas':22 'sdk':3,6,31,36 'separ':26 'two':25 'version':17 'week':24 'workflow':39","created_at":"2026-03-16T04:39:09.011572+00:00","updated_at":"2026-04-15T20:16:07.784718+00:00","problems":[{"fix":"Install the package using 'pip install anthropic'.","cause":"The 'anthropic' package is not installed in the Python environment.","error":"ModuleNotFoundError: No module named 'anthropic'"},{"fix":"Use 'from anthropic import AnthropicClient' instead.","cause":"The import statement is incorrect; 'Anthropic' is not a valid import from the 'anthropic' package.","error":"ImportError: cannot import name 'Anthropic' from 'anthropic'"},{"fix":"Instantiate the client with 'client = anthropic.AnthropicClient()'.","cause":"The 'Anthropic' class does not exist in the 'anthropic' module.","error":"AttributeError: module 'anthropic' has no attribute 'Anthropic'"},{"fix":"Initialize with 'client = anthropic.AnthropicClient(api_key=\"your_api_key\")'.","cause":"The 'AnthropicClient' class requires an 'api_key' argument during initialization.","error":"TypeError: __init__() missing 1 required positional argument: 'api_key'"},{"fix":"Ensure the API key is correct and properly formatted.","cause":"The provided API key is incorrect or malformed.","error":"ValueError: Invalid API key provided"}],"ecosystem":"pypi","meta_description":"anthropic · official Anthropic Python SDK · pip install anthropic · from anthropic import Anthropic · ImportError: cannot import name 'Anthropic' if version <0.20","install_score":100,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"0.107.1","cli_name":"","cli_version":null,"type":"library","homepage":"https://www.anthropic.com","github":"https://github.com/anthropics/anthropic-sdk-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/anthropic/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["llm-agents","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-27","last_verified":"2026-06-27","next_check":"2026-07-27","install_tag":"verified"}}