Usage and credits
How usage is measured, what the console shows, and how to keep spend bounded.
What is measured
Every response carries a usage object: prompt tokens, completion tokens and the total. That is
what billing reads, so your own numbers and ours agree by construction if you total it on your side.
"usage": { "prompt_tokens": 1024, "completion_tokens": 256, "total_tokens": 1280 }With streaming, ask for usage in the final chunk rather than counting deltas yourself, otherwise a retried or resumed stream is counted twice on your side and once on ours.
Credits
The console states usage in credits, where one credit is one cent, so 100 credits is one dollar. The
token rate does not change with the plan; what the plan changes is how many credits are included,
how much concurrency you get, the input ceiling on cog-pro, how long metadata is retained, and the
support you receive. See Plans and Pricing.
Where usage is attributed
To the key that made the request, always. That is what makes a budget per key meaningful, and it is the reason to give each project, each environment and each person their own key rather than sharing one.
Keeping spend bounded
Three controls, usable together:
- Per-key monthly budget. The key stops when the figure is reached. An unattended script cannot run past it.
- Concurrency per key. Bounds how fast a runaway loop can spend, which matters more than the budget when the failure mode is a retry storm rather than a long job.
- Cache reads. An agent that resends the same long prefix on every turn pays a tenth of the input rate for it once the prefix is cached. This is usually the largest single saving available.
Reading the numbers
curl https://api.cognitivers.com/v1/models \
-H "Authorization: Bearer $COGNITIVERS_API_KEY"For balances, budgets and per-key breakdowns, the console is the source of truth. If you need programmatic access to usage for a billing system of your own, say so through contact and we will tell you what is available today rather than guess at it here.