API key usage auditor
See where your tokens actually go. With your own OpenAI or Anthropic key, this auditor pulls recent usage straight from the provider, aggregates it by day, totals your consumption over the selected range, and projects next month’s volume from the trend — all without your key ever touching this site’s servers.
How it works
Both providers expose a usage endpoint that reports historical token consumption. The tool requests your chosen date range, sums the per-bucket token counts into a daily series, and derives a forward estimate:
total_tokens = Σ daily_tokens
daily_average = total_tokens / days_in_range
projection_30d = daily_average × 30
The request goes directly from your browser to the provider over HTTPS using the key you paste, so nothing is intermediated or stored here.
What to look for in the usage breakdown
Unexpected spikes. A day with 3× your usual token count is worth investigating — it could be a runaway retry loop, an accidental production rollout of a much longer prompt, or unauthorized use of your key.
Input vs output ratio. If you are spending heavily on output tokens, consider whether your max_tokens setting is appropriate. Models billed per output token can run unexpectedly expensive if completions are longer than anticipated.
Model composition. If you use multiple models, the per-model breakdown reveals which accounts for the most spend. A GPT-4-class model handling tasks that a cheaper model could do is a quick optimisation to find.
Weekend vs weekday patterns. Traffic that is user-driven should drop on weekends. Flat usage across seven days suggests a background job or scheduled task is the primary consumer, not interactive users.
Turning the usage report into a budget
Once you have the token total, multiply by your model’s per-token price to get a dollar figure:
cost = (input_tokens / 1_000_000) × input_price_per_M
+ (output_tokens / 1_000_000) × output_price_per_M
For a 30-day projection, multiply the daily average cost by 30. This is the same approach as the annual AI budget planner but derived from real actuals rather than estimates.
Tips and notes
- Use an admin-scoped key. Usage endpoints need organization or admin read permission; a plain project key will be rejected with a 401 or 403.
- Short ranges load faster. A 7- or 14-day window returns quickly and is enough to spot a trend; widen only when you need a fuller picture.
- Check for CORS. Provider usage endpoints may restrict browser origins. If a request is blocked, run the same query from a server-side script or the provider’s dashboard directly.
- Pair with cost figures. Multiply the projected tokens by your model’s price to turn the volume forecast into a dollar budget for the next planning cycle.