Connect clientsTutorial

Connect with Claude Code

Point Claude Code at the Anthropic-compatible endpoint.

By the end: Claude Code answers through RouteForge using a Claude model.

Claude Code speaks the Anthropic Messages protocol, which the gateway serves natively.

Environment

export ANTHROPIC_BASE_URL="https://www.ary4n73.com"
export ANTHROPIC_API_KEY="$ROUTEFORGE_API_KEY"

Choose a Claude model for these sessions — the Messages endpoint forwards to the Claude family. The model name must match the catalog exactly.

ANTHROPIC_BASE_URL takes the root, without /v1. Claude Code appends the Messages path itself.

Verify

Direct check

curl https://www.ary4n73.com/v1/messages \
  -H "x-api-key: $ROUTEFORGE_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-4-6","max_tokens":64,"messages":[{"role":"user","content":"hello"}]}'