Skip to Content
hackrouter

Claude Code

Run Claude Code on any model through hackrouter.

Claude Code talks to the Anthropic API. Point it at hackrouter with three variables, then start it as usual.

export ANTHROPIC_BASE_URL=https://api.hackrouter.ai
export ANTHROPIC_AUTH_TOKEN=$HACKROUTER_KEY
export ANTHROPIC_MODEL=deepseek-v4-pro
claude

ANTHROPIC_MODEL takes any model ID from Models. Models that are not Anthropic's own are translated from the Messages API, so Claude Code works with them too.

To keep the settings for good, put the same variables in the env block of ~/.claude/settings.json.

What does not carry over

  • Server tools. Web search, web fetch and code execution run on Anthropic's side and are billed there. hackrouter refuses requests that ask for them, so Claude Code's built-in web search does not work here. Tools that run on your machine, such as editing files and running commands, work as usual.
  • Priced betas. Beta features that Anthropic charges extra for, such as the 1M-token context, are removed from the request.

Each turn shows up in the console under Requests, with the model, tokens and charge.