Claude API Cost Tracking Spreadsheet Template
If you're searching for a Claude API cost tracking spreadsheet template, you're probably trying to answer one of two questions: "how much am I actually spending per feature/customer?" or "why did my bill jump this month?" A spreadsheet is the fastest way to get visibility without building internal tooling, and this article gives you a working template structure plus the formulas to make it useful.
Below you'll find the exact columns to use, copy-paste formulas for Google Sheets or Excel, and a note on when a spreadsheet stops being enough and you need something that tracks usage automatically instead of by hand.
The core spreadsheet structure
At minimum, a Claude API cost tracking sheet needs one row per request (or per batch of requests if you're aggregating) with these columns:
Date | Model | Input Tokens | Output Tokens | Input Cost | Output Cost | Total Cost | Feature/Endpoint | Environment | Notes
Here's why each column matters:
- Date — lets you build daily/weekly/monthly rollups with a pivot table.
- Model — Claude models have different per-token pricing, so cost calculations must be model-aware. Mixing Opus and Haiku rows without this column makes totals meaningless.
- Input Tokens / Output Tokens — pulled directly from the API response's usage object. Never estimate these from character counts; token counts and character counts diverge enough to skew cost projections by 15–30%.
- Input Cost / Output Cost — calculated fields (formulas below).
- Feature/Endpoint — this is the column most templates skip, and it's the one that actually answers "where is the money going." Tag each row with the internal feature name (e.g.,
summarizer,support-bot,code-review). - Environment — separates staging/test traffic from production so test runs don't inflate your real cost picture.
Pricing table (keep this on a second tab)
Set up a lookup table so your formulas don't hardcode prices:
Model | Input $/1M tokens | Output $/1M tokens
claude-opus-... | 15.00 | 75.00
claude-sonnet-... | 3.00 | 15.00
claude-haiku-... | 0.25 | 1.25
Update this tab whenever pricing changes — it's the single source of truth the rest of the sheet references, so you're not editing formulas across hundreds of rows.
Formulas that do the actual math
Assuming your data starts on row 2 and the pricing tab is named Pricing:
Input Cost = (Input_Tokens / 1000000) * VLOOKUP(Model, Pricing!A:C, 2, FALSE)
Output Cost = (Output_Tokens / 1000000) * VLOOKUP(Model, Pricing!A:C, 3, FALSE)
Total Cost = Input_Cost + Output_Cost
For a running monthly total by feature, use a pivot table with Feature/Endpoint as rows, Date grouped by month as columns, and Total Cost summed as values. This single pivot answers "which feature is expensive" faster than any dashboard you'd build yourself for a small project.
If you want a daily burn-rate alert without leaving the sheet:
=SUMIFS(Total_Cost_Range, Date_Range, TODAY())
Wrap that in a conditional format rule (red if greater than your daily budget) and you have a crude but effective cost alarm.
Where to get the token and cost numbers
The usage numbers you plug into the spreadsheet come from the usage object in every Claude API response:
{
"usage": {
"input_tokens": 512,
"output_tokens": 190
}
}
If you're logging requests yourself, append each response's usage data to a CSV or a logging sheet in real time rather than trying to reconstruct it later — token counts aren't always predictable from prompt length, especially with tool use or multi-turn context.
Where spreadsheets break down
A manually maintained spreadsheet works well up to a point — usually somewhere between "one developer testing an idea" and "multiple team members shipping features that call Claude in production." Past that point, a few problems show up consistently:
- Someone forgets to log a batch of requests, and your totals silently drift from your actual bill.
- You have no per-application or per-team breakdown because everyone shares one API key.
- You can't see cost in real time — you're always reconciling after the fact.
This is the gap SubToAPI is built to close. Instead of copying usage numbers into a sheet by hand, you generate a sub_live_... key per application or team, and every request's token usage and cost show up in the dashboard automatically — no manual entry, no drift between what you logged and what actually happened. If you still want your own spreadsheet view, you can pull the same usage data programmatically:
curl https://api.subtoapi.app/v1/messages \
-H "Authorization: Bearer $SUBTOAPI_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4",
"max_tokens": 512,
"messages": [{"role": "user", "content": "Summarize this ticket."}]
}'
The response includes the same usage metadata you'd log manually, so you can pipe it into a script that appends rows to Google Sheets via its API if you want to keep the spreadsheet as your reporting layer while SubToAPI handles the metering. See the quickstart and messages docs for the full response shape, and pricing for plan details (Solo, Team, and Scale tiers, each with a free trial).
A simpler starting point
If you just want the template without automation, copy the column structure above into a new Google Sheet, add the pricing lookup tab, apply the three formulas, and build one pivot table grouped by feature and month. That alone will tell you more about your Claude spend than most people get from staring at a monthly invoice.
questions
Do I need separate rows for input and output tokens, or can I combine them? Keep them separate. Input and output tokens are priced differently (output is typically 4–5x more expensive per token), so combining them into one "tokens used" column makes cost calculations wrong.
How often should I update the pricing tab? Check it whenever you notice pricing changes announced, and review it at the start of each month regardless. Since your cost formulas reference this tab via VLOOKUP, one update propagates through the entire sheet.
What's the fastest way to move from a manual spreadsheet to automated tracking? Route your Claude traffic through an API layer that records usage per key automatically. SubToAPI does this out of the box — each application gets its own key and dashboard, so you stop reconciling spreadsheet rows against your bill by hand.