Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Set your API key
Export your API key as an environment variable. The SDK reads ANTHROPIC_API_KEY automatically.
export ANTHROPIC_API_KEY="your-api-key-here"Create a project and install the SDK
mkdir claude-quickstart && cd claude-quickstart
python3 -m venv .venv && source .venv/bin/activate
pip install anthropicCreate your code
Create a file called quickstart.py:
import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-opus-5",
max_tokens=1000,
messages=[
{
"role": "user",
"content": "What should I search for to find the latest developments in renewable energy?",
}
],
)
for block in message.content:
if block.type == "text":
print(block.text)Run your code
python quickstart.py