One request must pass several independent gates
A valid key can have enough allowance but no funded balance, or a funded account can have a tightly scoped key. The per-request ceiling protects the specific approval, while a monthly cap limits broader use. A quote can also change if the actual source, duration or size changed since the earlier approval.
What to do next
- 01
Read the exact error
Record code, route and message without credentials. For 409, distinguish a changed-payload idempotency conflict from a quote exceeding max_credits before taking any action.
- 02
Compare the relevant values
Use /usage for balance and key allowance, /models for scope-related context, and a fresh /quotes result for the actual intended payload. Do not infer every rejection from one displayed balance number.
- 03
Correct only the approved condition
If the task changed, obtain a deliberate new approval. If balance is insufficient while purchases remain closed, explain that state rather than showing an unofficial payment path.
A concrete example
Illustrative diagnosis: an account has ample credits, but the key's remaining monthly allowance is smaller than the quote. Increasing max_credits would not resolve the cap and could weaken the user's per-request approval unnecessarily.
Identify the gate before changing anything
| Response | Likely gate | Check |
|---|---|---|
| 401 | Authentication | Full valid key and correct Bearer header |
| 402 | Shared wallet balance | Current account credits |
| 403 | Scope or monthly key cap | Exact message and key settings |
| 409 | Payload conflict or approval ceiling | Saved body and current quote |
| 429 | Rate, concurrency or daily control | Message, Retry-After and active work |
| 503 | Readiness or private delivery | Catalog reason and existing job |
Before you call it ready
- The exact error cause is identified.
- Permission, wallet and request ceilings remain separate.
- No limit is raised automatically.
When to stop or choose another method
If the application cannot determine which gate failed, preserve the task and investigate. Do not cycle through larger limits and repeated submissions until one happens to pass.
