Claude API · Setup and first request
Send your first message (curl)
The raw HTTP request behind the SDKs. Parse responses with jq rather than grep.
curl https://api.anthropic.com/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2026-10-21" \
-d '{
"model": "claude-opus-5-5",
"max_tokens": 16000,
"messages": [{"role": "user", "content": "What is the capital of France?"}]
}'
Official Claude API documentation
More setup and first request commands
- Install the Python SDK
- Install the TypeScript SDK
- Set your API key
- Send your first message (Python)
- Send your first message (TypeScript)
- Pick a model
All setup and first request commands · Claude API cheatsheet