An LLM gateway for Claude Code that caps what each developer spends.
Claude Code supports LLM gateways through environment variables. Point it at OpenPike and every session uses a virtual key you control, with a budget, a kill switch and loop detection in front of it. Your provider keys stay yours, and OpenPike takes no cut of the tokens.
How it fits together
Make a key for Claude Code
Create a virtual key named for the developer, tagged agent=claude-code. Shown once, stored as a hash.
Set two variables
ANTHROPIC_BASE_URL points at OpenPike and ANTHROPIC_AUTH_TOKEN holds the virtual key. Claude Code adds the rest.
Put limits on it
Add a daily budget, a loop limit and alerts on that tag, so a stuck session is paused in about a minute.
What you get
The Claude Code settings live in your user settings file, so they apply to every session, including background agents. OpenPike sees each request, so the spend shows up per developer and per tag in the dashboard.
- Budgets per developerA hard limit stops requests once a day or month is used up. A soft limit sends an alert first.
- Loop detectionPauses the key or tag when requests or spend per minute spike. Part of the Team and Business plans.
- Run limitsCap the spend and requests of one task, sent with
x-openpike-run, so a slow loop has a ceiling too. - Your own keysTokens are billed to the Anthropic or DeepSeek key in your workspace, at the provider's own prices.
The settings
Put this in ~/.claude/settings.json with your own virtual key. Keep it out of shared repositories.
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.openpike.dev",
"ANTHROPIC_AUTH_TOKEN": "opk_live_...",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "anthropic/claude-sonnet-5-5",
"ANTHROPIC_CUSTOM_HEADERS": "x-openpike-tags: agent=claude-code"
}
}
The full setup, including DeepSeek models and the context window variable, is in the Claude Code guide.
Give Claude Code a budget before the next long session.
Free for 3 keys and 10,000 requests a month. Loop detection is on Team and Business.
Start free