Skip to main content

Claude Code

Claude Code is Anthropic's official CLI for AI-assisted coding.

Quick Setup with Bankr CLI

The fastest way to get started is with the Bankr CLI:

# Print the env vars to add to your shell profile
bankr llm setup claude

Or launch Claude Code directly through the gateway — no manual config needed:

bankr claude          # shorthand for `bankr llm claude`

This sets ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN automatically and spawns Claude Code. You can pass any Claude Code flags after it:

bankr claude --model claude-opus-5
# Dotted form also works — bankr claude auto-translates it
bankr claude --model claude-opus-4.8
tip

If you haven't logged in yet, run bankr login first. The CLI uses your stored API key.

Model Format

Claude Code's --model flag (and the model field in ~/.claude/settings.json) accepts Anthropic wire IDs, which use dashes rather than dots in the version:

  • claude-opus-5
  • claude-sonnet-5
  • claude-opus-4-8
  • claude-haiku-4-5

If you pass the gateway-canonical dotted form (e.g. claude-opus-4.8), Claude Code silently falls back to its default — the flag appears honored but the real request is a different model, and you'll see the wrong model name in the UI banner.

bankr llm claude translates dotted → dashed automatically. If you invoke claude directly (via ANTHROPIC_BASE_URL) or edit settings.json by hand, use the dashed form explicitly.

1M-Token Context Tier

Claude Code exposes the 1M-token context tier as a [1m] model suffix (claude-opus-5[1m]). Through the Bankr gateway the suffix is optional — the gateway strips it before model lookup and enables the 1M beta from the model's own context window, so claude-opus-5 and claude-opus-5[1m] send an identical upstream request. Every model listed at 1M context in Available Models already gets the full window:

bankr claude --model claude-opus-5

Simply omitting the suffix is the easiest way to avoid the quoting problem below.

Quote the model id if you use [1m]

If you do pass the suffix, it must be quoted. In zsh (the macOS default) [1m] is a glob character class, so an unquoted id aborts the command before the CLI ever sees it:

zsh: no matches found: claude-opus-5[1m]

Bash passes it through literally, so the same command can work on one machine and fail on another. Always wrap it in quotes:

bankr claude --model "claude-opus-5[1m]"

The same applies when you invoke claude directly via ANTHROPIC_BASE_URL. Inside ~/.claude/settings.json it's already a JSON string, so no extra escaping is needed:

{ "model": "claude-opus-5[1m]" }

Private Inference

Route Claude Code through a hardware-secured enclave (TEE) by pointing it at an open-weight model with the :private suffix:

bankr claude --model glm-5.2:private

bankr llm claude forwards the model id verbatim — the dotted → dashed translation only rewrites Claude IDs and preserves any suffix — so the :private opt-in reaches the gateway unchanged. The gateway verifies the enclave's attestation on every request and fail-closes rather than downgrading. It works the same when you set "model": "glm-5.2:private" in settings.json or invoke claude directly via ANTHROPIC_BASE_URL.

Private inference covers open-weight models only (DeepSeek, GLM, Kimi, MiniMax, Gemma). Claude, GPT, and Gemini are not served confidentially, so there is no claude-*:private twin — append :private when you point Claude Code at an open-weight model. List the current set with bankr llm models --private, and see Private Inference for the full flow, response headers, and attestation verification.

Manual Configuration

Create or edit ~/.claude/settings.json:

{
"apiKeyHelper": "echo $BANKR_LLM_KEY",
"apiBaseUrl": "https://llm.bankr.bot"
}
Base URL

Use https://llm.bankr.bot (without /v1) for Claude Code.

Specifying a Model

{
"apiKeyHelper": "echo $BANKR_LLM_KEY",
"apiBaseUrl": "https://llm.bankr.bot",
"model": "claude-opus-4-8"
}

Environment Variables Alternative

You can also set environment variables in your shell profile (~/.zshrc, ~/.bashrc):

export ANTHROPIC_BASE_URL="https://llm.bankr.bot"
export ANTHROPIC_AUTH_TOKEN="bk_your_api_key_here"

See Available Models for all supported models.