APIMaster.ai

Claude API Python — Anthropic Messages API Integration

How to use the Claude API with Python or curl via the Anthropic Messages format. Set base URL and API key to access Claude Sonnet 4.6, Opus 4.8, and Fable 5 through APIMaster.ai at discounted pricing.

Claude Messages

For the Anthropic SDK or tools that call the Messages API, use:

  • Base URL: https://apimaster.ai (site root, no /v1; OpenAI uses https://apimaster.ai/v1)
  • API key: your APIMaster token

Example:

curl -s "https://apimaster.ai/messages" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 256,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Some clients send Authorization: Bearer instead of x-api-key. If one returns 401, try the other.

Claude Code / Desktop

  1. Open API Provider / Custom API in settings.
  2. API URL: https://apimaster.ai (no /v1)
  3. API Key: APIMaster console token.
  4. Model: e.g. claude-sonnet-4-6 (list).

See Claude Code for CLI env vars.