Status: [LIVE] Endpoints found: https://openrouter.ai/api/v1 https://openrouter.ai/api/v1` Source: https://github.com/Platform-Studio/beans_proxy # Beans Proxy A lightweight proxy for LLM API calls that records token usage and calculated cost per task by using a pseudo-API key. Built to be used with [Orchestra](https://github.com/platform-studio/orchestra) but useful standalone. ## How it works - Run Beans Proxy - Point Copilot / Cline / any OpenAI-compatible client at Beans Proxy (e.g. at https://127.0.0.1:8000) - Use any string you like as an API key (e.g. `sk-task-12345`) - Beans Proxy forwards the request to the upstream LLM API (e.g. OpenRouter), substituing in your actual API key - Beans Proxy records your token usage and calculated cost in a file keyed by the pseudo-API key (e.g. `token_usage/sk-task-12345.json`). Subsequent calls using the same pseudo-API key append to the same file. - A downstream system can read the JSON files directly or query the proxy for usage data - `GET /usage/{pseudo_key}`. ## Usage Data Usage data is stored in JSON. A successful call for a model with a known OpenRouter price produces a record like this. JSON numeric formatting may omit trailing zeroes, so `0.1200` will be stored as `0.12`. ```json { "started_at": "2026-06-24T21:52:33Z", "ended_at": "2026-06-24T21:52:35Z", "input_tokens": 15431, "output_tokens": 214, "model": "openai/gpt-5.4-20260305", "input_cost": 0.12, "output_cost": 0.0034, "total_cost": 0.1234, "currency": "USD" } ``` ## Calculating Pricing BeansProxy fetches latest pricing from OpenRouter and stores them in memory. To update pricing, just restart Beans Proxy. ## Quick command reference ```bash # Start the proxy in the background (loads .env in the current dir) ./beans.sh # default: start in background ./beans.sh --foreground # run in foreground (Ctrl-C to stop) ./beans.sh status # is it up? ./beans.sh stop # stop the background instance # Cline — sticky config in ~/.cline/data/settings/providers.json ./run_cline.sh sk-task-12345 "fix the login bug" # Copilot C