Claude Code

Point Claude Code at a Tokenmaxer key.

Install and initialize Ren

Install the Ren CLI, then pair it with your account before configuring this harness.

Terminal · Install
npm install -g @renai-labs/cli
Terminal · Initialize
ren init

Complete the browser pairing flow, then return here to continue.

Connect Claude Code to Tokenmaxer

Writes the configuration, backs up anything it touches, and adds only the models available from the providers you’ve configured in Tokenmaxer. Run it again after connecting another plan and it adds what is new.

Terminal
ren inference setup claude-code

Test it

Terminal
claude -p 'which model are you?'

The reply names a Ren model id, and `/model` lists the Ren models rather than stock Claude ones.

Configure it manually

Replace <YOUR_KEY> with your key.

  • Map the alias slots, not `ANTHROPIC_MODEL`

    Setting `ANTHROPIC_MODEL` alone pins you to one model. Mapping the four alias slots instead makes `/model opus|sonnet|haiku` and `--model` resolve to Ren models, so the picker keeps working.

  • `ANTHROPIC_SMALL_FAST_MODEL` is not an optimisation

    Claude Code runs background work on a small model, and without the override it requests a stock Haiku id the proxy does not serve.

  • `CLAUDE_CODE_ALWAYS_ENABLE_EFFORT` keeps the effort flag

    Claude Code gates the `--effort` selector on a hardcoded model list that these ids are not on. Without this, `--effort low|medium|high|xhigh|max` is unavailable.

  • The 1M models need a `[1m]` suffix

    Claude Code has no registry entry for these ids and falls back to a 200K window, so Opus, Sonnet and Fable compact four fifths early. `[1m]` on the model name is its own opt-in for the full window and is stripped before the request is sent. Haiku is left bare because 200K is its real window. `CLAUDE_CODE_DISABLE_1M_CONTEXT` turns this off again.

  • Codex models need an explicit context window

    Claude Code has no registry entry for these ids, assumes a 200K window, and starts auto-compacting 72K early. It warns on every run until `CLAUDE_CODE_MAX_CONTEXT_TOKENS` is set.

Claude models

~/.claude/settings.json

Points Claude Code at Ren and maps its four model slots, so `/model` and `--model` keep working.

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://llm.useren.ai",
    "ANTHROPIC_AUTH_TOKEN": "<YOUR_KEY>",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "anthropic/claude-opus-5[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "anthropic/claude-sonnet-5[1m]",
    "ANTHROPIC_DEFAULT_FABLE_MODEL": "anthropic/claude-fable-5-1[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "anthropic/claude-haiku-4-5",
    "ANTHROPIC_SMALL_FAST_MODEL": "anthropic/claude-haiku-4-5",
    "CLAUDE_CODE_ALWAYS_ENABLE_EFFORT": "1"
  }
}

ChatGPT models

~/.claude/settings.json

Points Claude Code at Ren's Codex pool.

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://llm.useren.ai",
    "ANTHROPIC_AUTH_TOKEN": "<YOUR_KEY>",
    "ANTHROPIC_MODEL": "openai/gpt-5.6-terra",
    "ANTHROPIC_SMALL_FAST_MODEL": "openai/gpt-5.4-mini",
    "CLAUDE_CODE_MAX_CONTEXT_TOKENS": "272000"
  }
}