Agent Cost Proxy — Development skill for Claude Code
One command: a local proxy for Claude Code, Codex, Hermes and OpenAI-compatible agents that records each call's real cost and the cheapest listed price for the same tokens, with optional spend caps.
How to install Agent Cost Proxy
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open xbtMelchizedek/agent-cost-proxy and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Agent Cost Proxy does
One command: a local proxy for Claude Code, Codex, Hermes and OpenAI-compatible agents that records each call's real cost and the cheapest listed price for the same tokens, with optional spend caps. Your key is never stored.
Alternatives in Development
- Dario — A local OpenAI- and Anthropic-compatible proxy that brings your Claude Pro/Max subscription to Cursor, Cline 485 ★
- Codex OpenAI Proxy — Proxy server to use ChatGPT Plus tokens with CLINE/Claude Code extensions via OpenAI API compatibility 124 ★
- Openapis — Free Claude API + free OpenAI API in one unified proxy 42 ★
README
agent-cost-proxy
What did your coding agent's calls really cost, and what would the same tokens have cost at the cheapest venue? Start one local proxy, point Claude Code, Codex, Hermes or any OpenAI-compatible agent at it, and keep working. Every call's real cost goes on an [agent-spendcap](https://github.com/xbtMelchizedek/agent-spendcap) ledger, next to the cheapest price [justweight](https://github.com/xbtMelchizedek/justweight) lists for the same model. Turn on caps and calls over budget never leave your machine.
**Page and report viewer:** https://xbtmelchizedek.github.io/agent-cost-proxy/
Quickstart
npx -y github:xbtMelchizedek/agent-cost-proxy
Then, in the shell where your agent runs:
export OPENAI_BASE_URL=http://127.0.0.1:8788/v1 # Codex, Hermes, OpenAI-compatible agents (upstream: OpenRouter by default)
For Claude Code, start it with `--upstream anthropic` and set `ANTHROPIC_BASE_URL=http://127.0.0.1:8788`.
Each call prints one line:
deepseek/deepseek-v4.1-flash · 100000 in / 100 out · $0.00509028 · cheapest listed: $0.00503 at pearl-labs (deepseek-ai/DeepSeek-V4.1-Flash)
To see the totals:
npx -y github:xbtMelchizedek/agent-cost-proxy report
Node 22 or later. Nothing to configure: no account, no config file, no key to give it.
Your key
- Whatever your agent already sends (
Authorizationorx-api-key) is passed straight through to the upstream. - If the agent sends no key, the proxy adds the upstream's usual one from its own environment:
OPENROUTER_API_KEY,OPENAI_API_KEYorANTHROPIC_API_KEY(orUPSTREAM_API_KEYfor a custom URL). - Keys, prompts and responses are never written to disk or printed. The files hold model, token counts, cost, status and timing. Tests check the files and logs for the key.
- Redirects from the upstream are refused, so a key is never re-sent to another host.
Local only
The proxy listens on `127.0.0.1` and nowhere else. It refuses:
- requests wit
Related Skills
Skinflint
Local proxy for the Anthropic and OpenAI APIs: hard spend caps for coding agents, a context token profiler, an
Tokens
Show the Monomind token usage dashboard — reports spend and call counts for today, week, 30days, or month
Baneh MCP
Unofficial read-only MCP server for Baneh (baaneeh.com): lets Claude, Cursor and Copilot search home appliance
Scvd Store Execution Contract
A behavioral contract for autonomous work. Name the success criteria before acting, spend the cheapest evidenc
Gen Budget
View or update spend caps (daily / weekly / monthly)
Financial Tracking
Report campaign cost estimates, refresh spend records, or reconcile them against an invoice.
Related Agents
Cost Forecaster
Forecasts GDD spend over the next N design cycles. Reads .design/telemetry/costs.jsonl (grouping est_cost_usd
X402 Warden
Budget gatekeeper for x402 operations. MUST approve every payment before the treasurer executes. Tracks spend/
Fintech UX
Use for UX, visual direction and copy of 402Lab web surfaces — the landing page that sells 'pocket money for A