By the end of this lesson every project will have its own API key with a monthly spend limit, and you will know how to read your usage to find what is costing money, before the bill surprises you.
You need: an AllModelAPI account (or any provider's dashboard), the coding agent you use for your project · Time: 7 minutes
An API key is the password your tools use to call a model. If one key is shared by everything (your coding agent, the fee tracker app, a test script), you cannot tell who spent what, and one runaway loop can use the whole month's money.
So make one key per project and per use, for example:
fee-tracker-agent: the coding agent building the fee tracker.fee-tracker-app-test: the app itself on your laptop and previews.fee-tracker-app-live: the live app, created only when you launch.
On AllModelAPI, open API keys and click Create API key:
- Key name: a clear name like
fee-tracker-agent. - Turn on Spend limit. The amount is in US dollars, Per month. It starts at a big number, so change it to what you planned, for example
$5for a weekend build. Requests stop automatically when this limit is reached. - Keep Notify me at 80% usage ticked.
- Create it, then copy the key. It is shown only once, so paste it straight into your tool's settings or your
.envfile, never into a chat or a commit (Keep secrets secret).
Do it now Do it now
CarefulA key without a limit is an open wallet. Agents can loop (try, fail, try again) for hours, and a leaked key can be used by strangers. A limit turns both into a small, known loss.
Why?Separate keys answer "who spent this?" at a glance, and a monthly limit on each one means a mistake in one project can never eat the budget of another.
Log in free to read the rest of this lesson
Every lesson is free. A free account unlocks all of them and saves your progress.
Still to come in this lesson:
- What happens at the limit
- Read your usage in two minutes
- Find the costly requests
- A five-minute money check every week
- Recap