First, sign up at console.anthropic.com and generate an API key. Then install the official SDK with pip install anthropic. Set your key as an environment variable: export ANTHROPIC_API_KEY=your_key_here. Then in Python you can do: import anthropic; client = anthropic.Anthropic(); message = client.messages.create(model="claude-opus-4-5", max_tokens=1024, messages=[{"role":"user","content":"Hello Claude"}]); print(message.content). That is all you need for a basic call.
answered 11 Apr 2026 by JordanStack (0 rep)