Claude Code with a custom API

To use Claude Code with Routeriva, set ANTHROPIC_BASE_URL=https://api.routeriva.com and ANTHROPIC_AUTH_TOKEN to your sk- key, then run claude as usual. Requests go to the native /v1/messages endpoint, so tools, thinking and caching all work.

Setup

export ANTHROPIC_BASE_URL=https://api.routeriva.com

export ANTHROPIC_AUTH_TOKEN=sk-your-key

claude

Pick a model

Use /model inside Claude Code, or set ANTHROPIC_MODEL=claude-sonnet-4-6.

FAQ

Does Claude Code count_tokens work?

Yes, /v1/messages/count_tokens is supported.