← Blog

Claude API Billing Dashboard for SaaS: What to Build

2026-10-18 · 5 min read · SubToAPI Team

If you're building a SaaS product on top of Claude, you need a billing dashboard that shows exactly how much each customer, team, or feature is costing you — in real time, not at the end of the month when the invoice arrives. This matters for two reasons: you need to price your product correctly, and you need to know when a single customer or runaway script is about to blow through your margin.

The direct answer is this: a Claude API billing dashboard for SaaS needs three layers — raw usage data (tokens in/out per request), attribution (which customer, team, or feature generated that usage), and presentation (a UI or API that turns raw numbers into dollars, limits, and alerts). Claude's own console gives you aggregate account-level spend, but it doesn't segment by your customers or expose that data as an API you can embed in your own product. That gap is what you have to fill yourself, or solve with a layer like SubToAPI that already tracks usage metadata per key.

Why Anthropic's console isn't enough for a SaaS

Anthropic's billing console shows you total spend across your organization. That's useful for your own accounting, but it doesn't answer the questions your SaaS actually needs answered:

None of that is possible from the console alone, because Anthropic bills at the account level, not per sub-key or per customer. If you're reselling Claude access as part of your product, you need to build that attribution layer yourself — or use a tool that already separates usage by API key.

What a good billing dashboard needs to track

At minimum, your dashboard (internal or customer-facing) should capture:

A minimal schema for logging each call looks like this:

{
  "customer_id": "cust_8821",
  "api_key_id": "sub_live_abc123",
  "model": "claude-3-5-sonnet",
  "input_tokens": 1423,
  "output_tokens": 587,
  "latency_ms": 2140,
  "timestamp": "2025-01-14T09:32:11Z"
}

You store that row per request, then aggregate it into whatever dashboard view you need — a chart, a CSV export, or a usage-based invoice line.

Build it yourself vs. use an issuing layer

There are two realistic paths.

Path 1: Build attribution on top of your own Claude API key. You wrap every call, log tokens and cost, tag by customer, and build the dashboard UI yourself. This works, but it's real engineering work: you need a logging pipeline, a cost calculation layer (prices change per model), and a UI. It's also easy to get wrong — forgetting to log a retried request, or miscounting tokens on streamed responses.

Path 2: Issue separate API keys per customer or team and let a billing layer track usage against each key. This is what SubToAPI does: it sits between your app and Anthropic, issues sub_live_... keys, and exposes per-key usage metadata — tokens, request counts, and cost — through the same dashboard you'd use to manage your team. Instead of building a usage-logging pipeline from scratch, you query usage per key and build your customer-facing views on top of that.

A simple example of pulling usage-relevant metadata from a request:

curl https://api.subtoapi.app/v1/messages \
  -H "Authorization: Bearer $SUBTOAPI_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-3-5-sonnet-20241022",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Summarize this report."}]
  }'

The response includes usage metadata (input/output token counts) that you can log and attribute the same way regardless of which key made the call — the difference is you're not maintaining your own proxy and cost-calculation logic. If you're issuing a separate key per customer or per team seat, usage naturally segments without extra bookkeeping. See /docs/messages for the full request/response shape and /docs/quickstart to get a key issued in a few minutes.

Designing the dashboard UI itself

Once you have attributed usage data, the dashboard layer is mostly product design:

  1. Top-level spend chart — daily/monthly, broken down by model if you use more than one.
  2. Per-customer table — sortable by tokens, cost, and request count, with a drill-down into individual requests if you need to debug a spike.
  3. Plan limit indicators — a progress bar showing how close a customer is to their quota, with a clear upgrade path when they hit it.
  4. Alert thresholds — notify internally (and optionally the customer) at 80% and 100% of allotted usage.
  5. Export — CSV or API export of usage data for finance/accounting reconciliation against your Anthropic invoice.

If you're issuing keys per team, seat-based plans (like SubToAPI's Team at €19/seat or Scale at €49/seat) map cleanly onto this: each seat gets its own key, usage rolls up per team, and your dashboard just reflects what's already tracked at the key level. See /pricing for how the plans break down.

Keep cost calculation separate from usage logging

A common mistake is hardcoding per-token prices into your logging code. Model prices change, and you'll eventually support more than one model. Store raw token counts and timestamps, then calculate cost at read time (or in a nightly batch job) using a price table you can update independently. This keeps historical data accurate even after a price change and makes your dashboard numbers trustworthy for both you and your customers.

FAQ

Can I see per-customer Claude API costs in Anthropic's own console? No. Anthropic's console shows account-level spend only. To attribute cost to individual customers or teams, you need to log usage per request yourself or use separate API keys per customer, as with SubToAPI's sub_live_... keys.

What's the minimum data I need to build a billing dashboard? Input tokens, output tokens, model name, and a customer/key identifier per request, timestamped. Everything else — charts, alerts, exports — is derived from that base data.

Should I calculate costs at logging time or at read time? At read time. Store raw token counts and apply a price table when generating reports. This avoids rewriting historical data every time Anthropic changes model pricing.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →