aicfo-spend-analysis
Open-source AI spend analysis, built on Ramp. Each month it answers two questions about a company's AI spend: where did it go, and where is it heading?
- Every dollar of Anthropic and OpenAI spend goes to a person and a team. Anything it can't place shows as Unassigned, with the reason.
- It projects this month and next, and flags days that spike.
- Ramp holds the Admin keys. This tool reads the AI spend Ramp already collects and never touches a key.
- It's plain Python with no add-on packages, and it runs without Claude. In Claude, the
ai-spend-analysis skill that ships in this repo fetches the data and shows the results.
Status
v1.0.0 is the latest release; it keeps no upgrade path from v0.3.3, the release before it, so set up again from stage 1 (v0.3.0 was the first that installs as a Claude plugin); CHANGELOG.md says what's in it, and the design is docs/design.md. Until a real month has been checked against them, the v0.3.0 scripts it replaces live in legacy/, moved here from claude-startup-finance with their history.
What you need
- Ramp, with your Anthropic or OpenAI Admin key (or both) added in Ramp's AI spend settings. A Ramp admin adds them, and this tool never touches a key.
- A Claude Team plan and one of its Owners. Each person's extra usage comes only from claude.ai's spend export, and the export and the member list are reached through an Owner's sign-in. Whoever runs the tool doesn't have to be that Owner.
- Claude Code 2.1.275 or later, to install the plugin. The engine on its own runs without Claude.
- Python 3.10 or later. The one built into macOS is 3.9, so a Mac needs a newer one.
In Claude
This repo installs as one Claude plugin, the engine and the skill together:
/plugin install ai-spend-analysis --marketplace aircfo/aicfo-spend-analysis
That installs the tagged release the marketplace file names, never unreleased work. To try unreleased work instead, load a checkout with claude --plugin-dir <checkout>. Then ask "set up AI spend tracking". Setup is a conversation in stages, and the first one needs only Ramp: Claude reads API spend and your people list from Ramp and publishes a dashboard that stays private until you share it. Your company's files are kept with that page, packed into one file published with it, so nothing depends on one laptop. Anyone you share the page with may be able to read that file through Claude's tools, so share the page only with people who may see names and spend, and don't open it to anyone with the link. In Cowork a run reads who the page is shared with and stores nothing when it's open that way; Claude Code's tools don't report sharing, so a session asks you, and a run nobody is watching can't check and says so. A copy already stored on a page that is later made public is open until the page is private again; the design says more. That takes one sitting. Each later stage is optional and adds one thing to the same page: the Claude usage export (each person's extra usage), seat prices, who holds which seat, a check against the vendors' bills, and a refresh each morning, run by a scheduled task on your own computer (a cloud task can do it instead, without the claude.ai export). Until a stage is done, the page says "not set up yet" where its numbers would go; say "continue setup" to add the next one. The skill is skills/ai-spend-analysis/SKILL.md, and its security overview is one page for whoever approves it.
Without Claude
uv tool install git+https://github.com/aircfo/[email protected]
aicfo-spend init ~/acme-ai-spend --company "Acme"
aicfo-spend settings ~/acme-ai-spend
init sets up a company's folder, which must sit outside any git repo because it will hold real spend data. Save Ramp's API spend and people list into it and the reports work; seat prices and seats bought go into its aicfo-spend.json when you have them, and settings checks the file and summarizes it. aicfo-spend setup <folder> lists the setup stages, which are done and what the next one adds.
Then save the month's inputs and report on it:
aicfo-spend save ~/acme-ai-spend ramp-people --start 2026-10-01 --file users.json
aicfo-spend save ~/acme-ai-spend ramp-api-keys --start 2026-09-01 --end 2026-09-30 --file keys.json
aicfo-spend save ~/acme-ai-spend ramp-provider-totals --start 2026-09-01 --end 2026-09-30 --file totals.json
aicfo-spend save ~/acme-ai-spend claude-spend-export --start 2026-09-01 --end 2026-09-30 --file spend.csv
aicfo-spend report ~/acme-ai-spend 2026-09
aicfo-spend forecast ~/acme-ai-spend
aicfo-spend pace ~/acme-ai-spend
aicfo-spend dashboard ~/acme-ai-spend