Skip to content

Claude subscription

Already paying for Claude Pro or Max? Use that plan as a model source. routeplane providers login anthropic runs the same OAuth flow Claude Code uses, stores a refreshing token, and attaches it to every request to the anthropic provider — so your subscription’s usage covers the tokens and there’s no ANTHROPIC_API_KEY to manage.

**Subscription, not API key.** This is the OAuth path — it bills against your Claude plan. If you'd rather pay per token with an Anthropic API key, skip the login and set `ANTHROPIC_API_KEY` in the environment instead; the same `anthropic` provider picks it up automatically.
Terminal window
routeplane providers login anthropic

This opens Anthropic’s authorize page in your browser (PKCE), and on approval stores the credential under $XDG_DATA_HOME/routeplane/oauth-tokens.json. The token auto-refreshes — you log in once. To check or remove it later:

Terminal window
routeplane providers logout anthropic # remove the stored credential
**One auth mode per request.** A request uses your OAuth subscription **or** an API key, never both. If a stored login exists it wins; otherwise Routeplane falls back to `ANTHROPIC_API_KEY`. Run `routeplane providers logout anthropic` to switch back to key-based billing.

Each credential is keyed by (provider, label). Pass --label to keep more than one Claude account side by side:

Terminal window
routeplane providers login anthropic --label work
routeplane providers login anthropic --label personal

No routeplane.yaml block is required — the anthropic provider is built in, and the stored credential is found at request time. Address Claude models by their registry id:

Terminal window
routeplane route anthropic:claude-sonnet-4-6

Then start Routeplane and send a request. Use the provider-qualified id anthropic:claude-sonnet-4-6 to pin the request to your subscription, or the bare model name to let Routeplane cascade across active sources.

Run Claude Code through Routeplane (with telemetry)

Section titled “Run Claude Code through Routeplane (with telemetry)”

Use Routeplane as a transparent harness for the Claude Code CLI — with Routeplane in the path purely for side-effects: observability today, optional model rerouting tomorrow. From a freshly-installed routeplane:

1. Adopt your existing Claude Code session as the claude-code subscription provider (drives the claude CLI’s own login if you’re not signed in yet):

Terminal window
routeplane providers login claude-code

2. Turn on full first-party telemetry (off by default) — create ~/.routeplane/routeplane.yaml:

server:
skip_auth: true # local daemon: admit credential-less spawn traffic
plugins:
routeplane-observe:
telemetry:
enabled: true # nothing is exported unless you opt in
level: full # metadata + request/response content (use `metadata` to omit content)
# endpoint omitted → defaults to https://telemetry.routeplane.app

3. Start the daemon in the background and verify it’s up:

Terminal window
routeplane start # detached; logs to ~/.routeplane/routeplane.log
routeplane status # running: yes — listen 127.0.0.1:4356
routeplane observe status # telemetry exporter endpoint + state

4. Launch an interactive Claude Code session pointed at Routeplane:

Terminal window
routeplane spawn -a claude # interactive; run `routeplane stop` when you're done

Genuine Claude Code traffic — recognised by its anthropic-beta: claude-code-* agent-profile marker — is routed to your subscription; anything else falls through to your other configured providers. Telemetry is attributed to an anonymous install id. (Optional: run routeplane cloud login first to also serve non-Claude-Code models from your Routeplane Cloud account.)

  • Claude Code — point the Claude Code CLI at Routeplane (a harness), distinct from using your plan as a model source above.
  • Models — the full provider/model id scheme.
  • Model fallback — fail over from your subscription to a hosted model on overload.