Skip to main content

Claude Code

Point Claude Code at Primex instead of api.anthropic.com — usage is billed through your prx- key.

Setup

export ANTHROPIC_BASE_URL=https://gateway.primex.work
export ANTHROPIC_API_KEY=prx-YOUR_KEY
claude # works — billed through Primex
note

The base URL has no /v1 suffix — Claude Code appends /v1/messages itself.

Supported models

Any enabled Anthropic model — claude-opus-4-8, claude-sonnet-4-6, claude-haiku-4-5, claude-fable-5. Set your model with /model inside Claude Code or the ANTHROPIC_MODEL env var.

What this does not cover

Claude Code is hardwired to Claude model names, so it can't drive GPT / Grok / DeepSeek through Primex. For those, use Cursor / Windsurf / Codex or the OpenAI SDK against the OpenAI-compatible endpoint.