Claude Code
Point Claude Code at a Gateway key.
Run this
Writes the configuration below, backs up anything it touches, and picks up only the models your key actually serves. Run it again after connecting another plan and it adds what is new.
ren inference setup claude-codeCheck it worked
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 by hand instead
The same result, written yourself. 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.
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.
{
"env": {
"ANTHROPIC_BASE_URL": "https://llm.useren.ai",
"ANTHROPIC_AUTH_TOKEN": "<YOUR_KEY>",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "anthropic/claude-opus-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "anthropic/claude-sonnet-5",
"ANTHROPIC_DEFAULT_FABLE_MODEL": "anthropic/claude-fable-5",
"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.
{
"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"
}
}