🧾 MYCLOUDBILLS · INSTALL

Run your own spend lake

One bucket you own. Small collectors you deploy. A browser page that reads them. You run every piece, and nothing is sent anywhere else.

About 30 minutes for your first vendor, minutes for each one after.

This guide walks you through:

Prerequisites

  1. Create a Cloudflare account. Sign up if you don't have one, then add the $5/month Workers Paid plan (dash β†’ Workers & Pages β†’ Plans). The free tier caps cron triggers and CPU too low for a multi-vendor fleet.
  2. Install Node.js 18+. It gives you npx, which runs Cloudflare's wrangler CLI as npx wrangler β€” no separate install. Sign in once with npx wrangler login.
  3. Have an account with each vendor you want to track, and the ability to mint a read-only billing credential there. Step 2's table lists exactly which key each vendor needs (and any gotchas, e.g. OpenAI/Anthropic need an Admin key; Anthropic needs a Team/Org).
New to Cloudflare Workers & R2?

Workers run your collectors on a schedule; R2 is Cloudflare's S3-compatible object storage with zero egress β€” which is exactly why your browser can read it directly, with no server of ours in the middle. The $5/mo Workers Paid plan covers both; a real multi-vendor fleet uses under 1% of what it includes, so there's no usage bill to watch.

1Make the bucket you own

One R2 bucket holds every vendor, each under its own prefix (aws/, fireworks/, …).

npx wrangler r2 bucket create mycloudbills

mycloudbills is just the default β€” bucket names are unique within your own account, so any name works and won't collide with anyone else's.

2Deploy a collector

A collector is a small folder: a WASM Worker on a Cron Trigger that reads one vendor's billing API and writes a daily rollup to your bucket. Pick a vendor and run three commands:

cd fireworks2parquet/worker
npx wrangler secret put FIREWORKS_API_KEY
npx wrangler deploy

Then run it once instead of waiting for the cron. wrangler deploy prints the Worker's URL β€” just curl that. It looks like:

curl https://fireworks2parquet.<your-workers-name>.workers.dev

<your-workers-name> is your account's workers.dev name β€” you pick it once per Cloudflare account (e.g. acme β†’ acme.workers.dev), and every Worker you deploy lives under it. It's not per-Worker, so the simplest thing is to copy the exact URL from the wrangler deploy output.

Available collectors

CollectorReadsCredential
fireworks2parquetFireworks usage + rated costFIREWORKS_API_KEY + FIREWORKS_ACCOUNT_ID var
cartesia2parquetCartesia credits + agentsCARTESIA_ADMIN_API_KEY
openrouter2parquetOpenRouter Analytics APIOPENROUTER_API_KEY (management key)
aws2parquetAWS Cost Explorer, daily by serviceAWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY
cloudflare2parquetCloudflare usage β€” Workers + R2CLOUDFLARE_API_TOKEN (Analytics read) + CLOUDFLARE_ACCOUNT_ID var
twilio2parquetTwilio Usage Records β€” SMS, voice, numbersTWILIO_API_KEY_SID + TWILIO_API_KEY_SECRET (or TWILIO_AUTH_TOKEN) + TWILIO_ACCOUNT_SID var
openai2parquetOpenAI org Costs API, daily by line itemOPENAI_ADMIN_KEY (Admin key β€” Owner/Admin)
anthropic2parquetAnthropic Admin Cost Report, dailyANTHROPIC_ADMIN_KEY β€” an Admin key (sk-ant-admin…). Requires an Anthropic Team/Organization (convert from an individual account): only then does the Admin keys page exist. Regular (sk-ant-api…) and service (sk-ant-svc…) keys are rejected by the cost API.
subscriptions2parquetFlat subscriptions / seats (ChatGPT Plus, Claude seat, Cursor…) β€” amortized dailyNo key, no API. Edit subscriptions.json (name + usd_per_month), then deploy. Captures the flat SaaS spend that no usage API reports.
Keys are secrets β€” always wrangler secret put. Never put them in wrangler.toml, and never commit them. Give each credential the narrowest read scope the vendor allows.

3Let the browser read the bucket

The page reads R2 directly from your browser, so the bucket needs two things.

4Open the page

Go to mycloudbills.com/ai-spend.html. Enter your R2 account id, the bucket name, and the read-only Access Key ID + Secret. The page lists every prefix, pulls the Parquet, and does all the math locally. Your keys never leave the tab.

5Add more vendors

Repeat step 2 for each collector you want. The page picks up new prefixes automatically β€” no changes to the page, and no changes to the reader.

That's the whole path. Everything below is optional.

What it costs

$5/month, flat. Run the account on the Workers Paid plan and stop thinking about it. That plan includes 250 Cron Triggers, 10M requests, and 30M CPU-ms per month; a real multi-vendor fleet uses under 1% of it, so you never see a usage bill. Each collector's wrangler.toml caps CPU per run (cpu_ms = 1000), so a bug can't run away. The viewer is free β€” a static page on R2, zero egress, open it as often as you like.

Optional β€” use a different bucket name

Edit bucket_name in that worker's wrangler.toml before deploying.

Optional β€” host the page yourself

Run make publish to build the wasm and deploy web/ to Cloudflare Pages (it provides the domain, HTTPS, and correct content-types). The web/ files are fully static, so any static host works too.

Optional β€” add AWS

Deploy aws2parquet/cloudformation.yaml for a read-only ce:Get* user, then enable Cost Explorer once in the console. This adds about $0.30/month β€” Cost Explorer bills $0.01 per call on a daily cron.

Optional β€” add Cloudflare

The token needs Account Analytics: Read (not billing). It's usage-forward: you see Workers requests/CPU-ms and R2 storage/ops trending toward the included limits ("am I about to tip into overages?"), with $0 billed until you do.

Optional β€” cost-per-task with OpenRouter

OpenRouter returns cost by model. session_id is available if you want to break spend down by task/conversation later.

Optional β€” add a vendor we don't cover

Any vendor with a billing or usage API can become a collector β€” see COLLECTORS.md for the full recipe and a paste-ready prompt. The only per-vendor work is mapping that API's response to a daily (day, model/service, cost) rollup.

Want a private or internal billing source wired in for your company? That bespoke work is something we can do for you β€” get in touch.

Learn more

FAQ β†’

Privacy & the trust model, self-hosting, how it compares to SaaS FinOps tools, and tracking flat subscriptions.

Live demo β†’

Realistic sample data, no setup β€” see the viewer before you install anything.

Add a collector β†’

COLLECTORS.md has the recipe, a paste-ready prompt, and the test bar a PR must clear.

← Home Live demo Launch the app

AWS, Cloudflare, Fireworks, Cartesia, OpenRouter, OpenAI, Anthropic, and Twilio are trademarks of their respective owners. MyCloudBills is an independent open-source project and is not affiliated with or endorsed by these providers.