A Retrospective Meeting That Could Have Been Avoided
At the end of last month, our team received a headache-inducing bill: API call costs were 60% over budget. At the retrospective meeting, the colleague responsible for the recommendation system blamed the customer service bot, the customer service team blamed the data analysis scripts for running too much, and the independently-connected analyst insisted "I only made a few calls."
Where was the problem? All projects shared a single API Key, and all calls were mixed into one bill. We couldn't say how much each project spent, nor could we determine which types of calls should be cut and which projects should scale up. Even worse, a test script written by an intern called a high-performance model inside a loop and ran for an entire weekend, with no mechanism able to stop it midway.
This retrospective made me realize: the core of API budget governance isn't saving money—it's making the ownership and accountability of every cent traceable. And budget splitting by project is where this starts.
Why Split by Project Instead of by Model
Many teams initially look at usage only by model—"how much did the large model cost this month, how much the small one." This perspective has a fatal flaw: it can't answer "who is spending" or "why." The model dimension only tells you price differences; the project dimension can answer:
- Which project's ROI justifies additional investment
- Which project's calls show anomalies or waste
- When the budget is exceeded, which team bears responsibility
From a manager's perspective, budget splitting is essentially a process and collaboration problem, not a technical one.
Three Practical Approaches: A Path from Coarse to Fine Budget Governance
Approach 1: Multi-Key Isolation — The Lowest-Cost Physical Split
The most straightforward approach is to apply for a separate API Key for each project. One Key for the customer service bot, one for the recommendation system, one for internal tools.
Pros: Nearly zero changes required; bills are naturally separated by Key.
Cons: As Keys multiply, management overhead grows—rotation, permissions, and payment status all need separate maintenance; and since usage dashboards vary across providers, cross-vendor aggregation still requires manual work.
Suitable for getting started, but pair it with a unified naming convention (e.g., proj-customer-bot-prod), otherwise in three months nobody will remember which Key corresponds to which service.
Approach 2: Unified Gateway Access + Project-Level Tokens — The Main Path I Recommend
Route all project calls through a single API gateway, which issues independent access tokens for each project, with all calls forwarded through the gateway to upstream model providers. This is the core value we experienced when using the ThisToken.AI gateway: one entry point, multi-dimensional accounting.
The specifics:
- One token per project: The token is not just an authentication credential—it's the accounting unit. The gateway dashboard shows each project's call volume, token consumption, and error rate in real time, not at month's end.
- Model whitelists: Only open mid-tier models for the customer service bot project, banning the most expensive tier; open high-performance models for the recommendation system's offline tasks but with daily quotas. This way, the "intern looping calls to a large model all weekend" incident is blocked at the mechanism level.
- Managed channels as a fallback: When the primary channel's quota is exhausted or responses are abnormal, managed channels can degrade to backup models according to preset rules, avoiding business disruption while preventing the hidden cost of "manually switching to an expensive model in an emergency and forgetting to switch back."
The key to this approach: governance rules live in configuration, not in group announcements. Group announcements get ignored; configurations don't.
Approach 3: Call Tagging + Usage Attribution Analysis — Fine-Grained Operations
On top of gateway tokens, you can also attach tags to each call on the business side (feature module, user ID, task batch), enabling attribution finer than the project level. Typical scenarios:
- Within the same project, how much cost each of the "auto-summary" and "intelligent Q&A" features accounts for
- How many tokens a B2B customer actually consumed, and whether the pricing is reasonable
- In A/B tests, the cost difference between two prompt strategies
This layer of attribution upgrades budget discussions from "we went over this month" to "this feature's unit cost is too high; it's worth optimizing the prompt or downgrading the model." For independent developers, the same mechanism can be used to calculate "the AI cost per active user of my product"—which directly determines pricing.
A Budget Governance Checklist from a Manager's Perspective
| Governance Item | Concrete Action | Risk Scenario |
|---|---|---|
| Project isolation | Independent token per project, sharing prohibited | Overspending can't be traced; troubleshooting is like finding a needle in a haystack |
| Model whitelist | Configure available model tiers per project | Test code accidentally uses flagship models, causing waste |
| Usage quotas | Set project-level daily/monthly limits and alerts | A script with an infinite loop runs all night unnoticed |
| Real-time dashboard | View usage trends by project in the gateway dashboard | Overspending discovered only at month's end—too late |
| Degradation plan | Configure automatic degradation rules for managed channels | Complete business outage when the primary channel fails |
| Regular retrospectives | Hold a 15-minute retrospective per month based on project-level billing data | Budget governance becomes a one-time campaign |
Implementation Pace: Don't Do Everything at Once
My advice for managers and independent developers is to proceed in three steps:
Step 1 (completable this week): Route all calls through the gateway, issue project-level tokens, and just observe without changing any call logic.
Step 2 (within two weeks): Based on observed data, set up model whitelists and quotas—loose first, then tight—to avoid harming business.
Step 3 (after a month): Introduce business tags for fine-grained attribution and incorporate billing data into the regular retrospective process.
One risk-control principle is worth upholding: all rule changes go through a configuration change process with records kept. Who opened up more expensive models for which project and when, who raised quotas—all of it should be traceable. This isn't just for accountability, but so that in the next budget dispute, the discussion is based on data rather than memory.
Final Thoughts
After implementing project-level billing, the most visible change wasn't a lower bill, but the atmosphere of the monthly retrospective meeting—people no longer suspect each other of overspending; instead, each person looks at their own project's curve and discusses where to optimize. Done well, budget governance saves not just API costs, but also the trust consumed between teams.
If your team is still sharing one Key and pointing fingers at a mixed bill at month's end, consider starting with a gateway that supports project-level tokens, model whitelists, and real-time usage dashboards. The ThisToken.AI gateway was designed for exactly these scenarios—register here: https://api.thistoken.ai/register
---
Every example in this post runs with a single API key — get yours at https://api.thistoken.ai/register and start in minutes.
Хотите попробовать Token.AI?
Создайте API Key уровня проекта, включите каналы в консоли и настройте маршрутизацию, бюджеты и журналы аудита.
注册 ThisToken.AI 并获取 API Key