Anthropic's official coding agent (CLI + VS Code extension). The one command below sets everything up; prefer to see each step — the full manual walkthrough follows, with troubleshooting at the end.
Grab a key from the Keys page, run the command for your OS, paste the key when asked. The script installs Claude Code if it's missing using a checksum-verified distribution download, then configures OpusGate (~/.claude/settings.json, an existing file is backed up to .bak), and never sends your key anywhere except that local file.
irm https://opusgate.dev/install.ps1 | iex
curl -fsSL https://opusgate.dev/install.sh | bash
Then just run claude (on Windows — in a new terminal). Piping scripts from the internet? Right to be careful — read the source first: install.ps1 / install.sh. Prefer manual setup? Follow the steps below.
Everything the installer does, by hand — install, then permanent config via settings.json, then run.
ANTHROPIC_BASE_URL = https://api.opusgate.dev — no /v1 suffix, Claude Code adds the path itself.ANTHROPIC_AUTH_TOKEN = your sk-og-... key from the Keys page.Skip if claude --version already works.
curl -fsSL https://claude.ai/install.sh | bash claude --version
irm https://claude.ai/install.ps1 | iex
After the installer finishes, fully close and reopen PowerShell, then check claude --version. Prefer npm? npm install -g @anthropic-ai/claude-code works on all platforms.
Claude Code reads ~/.claude/settings.json on every start — configure once and forget. Both the CLI and the VS Code extension use the same file.
~/.claude/settings.jsonWindows%USERPROFILE%\.claude\settings.json{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"env": {
"ANTHROPIC_BASE_URL": "https://api.opusgate.dev",
"ANTHROPIC_AUTH_TOKEN": "sk-og-...",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5.5",
"DISABLE_TELEMETRY": "1",
"DISABLE_ERROR_REPORTING": "1"
}
}Already have a settings.json? Merge the env block into it instead of replacing the file.
"ANTHROPIC_BASE_URL": "https://api.opusgate.dev", "ANTHROPIC_AUTH_TOKEN": "sk-og-..."
Routes every request to OpusGate instead of the official Anthropic endpoint. Use ANTHROPIC_AUTH_TOKEN (sent as a Bearer token), not ANTHROPIC_API_KEY — the token variant is the correct field for a gateway and also stops Claude Code from asking you to log in to Anthropic.
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5", "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5.5"
Claude Code's /model menu has three fixed slots — Opus, Sonnet, Haiku. These variables re-map each slot to an OpusGate model ID. Use an available Claude model from the catalog and check its supported features. The example IDs above were checked against the catalog on 17 October 2026.
DISABLE_TELEMETRY and DISABLE_ERROR_REPORTING stop Claude Code's usage analytics and crash reports to Anthropic. They do not affect functionality — keep or drop as you like.
The one-command installer from the top of this page can also run unattended — pass the key inline instead of typing it at the prompt:
$env:OPUSGATE_KEY = "sk-og-..."; irm https://opusgate.dev/install.ps1 | iex
curl -fsSL https://opusgate.dev/install.sh | OPUSGATE_KEY="sk-og-..." bash
claude
That's it — the config is picked up automatically. To verify the connection, ask it anything; the first reply confirms billing against your OpusGate balance (check Transactions). Switch models any time with /model.
For a quick test only — the variables live until you close the terminal.
export ANTHROPIC_BASE_URL="https://api.opusgate.dev" export ANTHROPIC_AUTH_TOKEN="sk-og-..." claude
$env:ANTHROPIC_BASE_URL = "https://api.opusgate.dev" $env:ANTHROPIC_AUTH_TOKEN = "sk-og-..." claude
~/.claude/settings.json from step 2 exists — the extension reads the same file.Ctrl/Cmd + ,) enable Claude Code: Disable Login Prompt so it stops offering an Anthropic sign-in.Developer: Reload Window).claude is not recognizedClose PowerShell completely and open a new window — PATH updates don't reach already-open terminals. Still failing? Run where.exe claude: if nothing is found, re-run the install script from step 1.
That means it doesn't see your token. Check that the key is set as ANTHROPIC_AUTH_TOKEN (not ANTHROPIC_API_KEY) and that settings.json is valid JSON — a trailing comma silently breaks the whole file. If you previously logged in with an Anthropic account, run /logout once.
invalid_api_keyThe key was mistyped, revoked, or has whitespace around it. Keys are shown once at creation — if in doubt, issue a new one. All error responses are listed on the error codes page.
Almost always an empty balance. Top up and retry — no restart needed.