I build spend-pacing systems for ad auctions for a living, and my side-project agent workloads still kept surprising me with API bills I couldn't explain. When I asked around how people attribute LLM spend, the answers were the provider dashboard or a spreadsheet.

llm-spend is a local CLI that pulls usage from the OpenAI/Anthropic reporting APIs, breaks spend down by key, model and project, projects end-of-month, and flags days that look abnormal against the same weekday's history. It also does a second, independent read of the provider's cost API and warns if the totals disagree by more than 1%. That check exists because I don't want to ship you a wrong report: it catches unit, pagination and grouping bugs in my own pipeline. It checks against the provider's cost API, not your invoice — credits, tax and non-API charges live elsewhere.

Keys are the ugly part. OpenAI admin keys can be scoped down to read-only usage/cost access, but admin keys require a Team plan. Anthropic admin keys can't be scoped down at all. That's why there's a CSV path: export your usage data, reshape it once into the tool's documented schema, and run the report fully offline with no key. The CSV path skips the 1% cross-check though, since it can't fetch anything to check against. There's also a demo with synthetic data in the README if you just want to see what the report looks like.

Non-goals: no cross-model "you could have saved 40%" estimates from aggregate data (different tokenizers make that dishonest), no proxy in your request path, nothing hosted. Apache-2.0, Python 3.12+.

If you're on LiteLLM: not a replacement. The next version is planned as a LiteLLM guardrail plugin for budget pacing — audit shipped first because you can't enforce budgets on numbers you can't verify.

If you run agent swarms on API-key billing, I'd like to hear two things: how do you attribute spend to a specific run or agent today, and what happens when a run blows past what you expected?

Show HN: LLM-spend – Audit your OpenAI/Anthropic API spend locally
github.com