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

All setup and first request commands · Claude API cheatsheet

Was this page helpful?