Status: [UNTESTED] Endpoints found: http://127.0.0.1:8787/v1/chat/completions http://127.0.0.1:8787/v1/chat/completions?project=demo http://127.0.0.1:8787/api/export.csv?project=demo http://127.0.0.1:8787/api/export.json?project=demo http://127.0.0.1:8787/api/export.csv?model=gpt-4o-mini Source: https://github.com/realvaleh/Spendlight # Spendlight Drop-in **OpenAI-compatible** reverse proxy for your laptop. Point any client at Spendlight instead of the provider, keep (or omit) your API key, and get a local spend ledger, soft/hard budgets, and shareable receipts. Swap the base URL. That is the whole integration. > **v1 is cost, budgets, and receipts only.** It is not a gateway, a tracer, or a billing system. ![Spendlight dashboard](docs/dashboard.png) ## What it is A single Node process that: 1. Speaks the OpenAI Chat Completions API at `/v1/chat/completions` (other `/v1/*` paths pass through). 2. Forwards to any OpenAI-compatible upstream (`OPENAI_BASE_URL` + `OPENAI_API_KEY`). 3. Writes a spend ledger (model, tokens, estimated USD, project tag, timestamp, request id). 4. Warns on a **soft** budget and rejects further mutating `/v1` calls with **402** when a **hard** budget is hit. 5. Serves a one-page dashboard, Markdown + SVG receipts, and a README badge. ## What it isn’t (v1 non-goals) - Tracing, evals, or an observability suite - Multi-provider routing, load balancing, or failover - Auth on the dashboard — this is a **local** tool; bind to localhost - Perfect, billing-grade invoices — costs are **estimates** from a local price table - A public or shared-team proxy — do not put it on the internet ## Architecture ``` OpenAI SDK / curl / app | | baseURL = http://127.0.0.1:8787/v1 v ┌──────────────────────────────────────────┐ │ Spendlight │ │ / local dashboard │ │ /api/export.csv spend ledger CSV │ │ /api/export.json spend ledger JSON │ │ /receipt.md .svg shareable receipts │ │ /badge.svg README badge │ │ /v1/* reverse proxy │ │ │ │ │ ├─ hard