Per-key limits do not partition cash
This matters when several applications use one account. Their individual caps can add up to more than the actual balance, and a quote is not a hold on funds. GET /usage reports both the account balance and the authenticating key's allowance; recent visible jobs should not be mistaken for a separate key-only bank statement.
What to do next
- 01
Label applications clearly
Create purposeful key names and track which backend uses each one. Use narrow model scopes and suitable monthly caps to constrain potential spending, not to simulate nonexistent subaccounts.
- 02
Check both ceilings
Before submission, compare the live quote with the wallet and this key's remaining allowance. Handle a later 402 gracefully if another request spent credits after your preflight.
- 03
Reconcile by task
Keep your own application-to-job records and credit receipts. Those records explain usage across keys without assuming the recent-jobs list is a complete application accounting system.
A concrete example
Illustrative arrangement: an image worker has a 200-credit cap and a video worker has a 500-credit cap. With only 100 credits in the shared wallet, neither cap guarantees that its entire allowance can be spent.
Before you call it ready
- The shared balance has one clear meaning.
- Caps are described as limits rather than allocations.
- Concurrent spending can invalidate an earlier balance check.
When to stop or choose another method
If independent project funding is essential, do not market per-key caps as isolated prepaid wallets. Design an application-level budget ledger and state its limitations explicitly.
