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.primexos.com
export ANTHROPIC_API_KEY=prx-YOUR_KEY
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
claude # billed through Primex
note

The base URL has no /v1 suffix. Claude Code appends /v1/messages itself. Keep CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 in your shell when testing with claude --bare too.

Supported models​

Use any enabled Anthropic model returned by the live catalogue. Set the model with /model inside Claude Code or the ANTHROPIC_MODEL environment variable.

Claude Sonnet 5.5 is currently coming soon. When it becomes available, integrations must use tool_choice: {"type": "auto"} or {"type": "none"}; this model rejects forced tool selection. To turn off up-front thinking, use thinking: {"type": "between_tools"} with low, medium, or high effort. Keep thinking blocks unchanged when continuing a conversation. See Anthropic's Sonnet 5.5 migration notes.

What this does not cover​

Auto-mode classifier billing​

Claude Code's no-charge classifier feature uses real server-side safety review, not a blanket exemption for classifier-labelled requests. It requires the provider to receive safeguards and return usable safeguard_results; availability also depends on the provider's rollout. Client-side classifier fallback calls remain billed as ordinary token usage.

If Claude Code says your session is ineligible, auto mode still works. To suppress the notice while explicitly keeping the billed client-side fallback, set:

export CLAUDE_CODE_AUTO_MODE_SERVER=0

This does not make classifier calls free or disable auto-mode safety checks. Use /status to inspect the Auto mode server setting. See Anthropic's classifier billing guide.

Other model providers​

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.