
API key spending limits: daily, weekly and monthly ceilings
Give each API key its own spending ceiling and reset period, read what is left from GET /api/v1/key, and stop a batch before it runs into a 402.
How the gateway behaves on the wire: errors, limits, usage and billing. 4 posts.

Give each API key its own spending ceiling and reset period, read what is left from GET /api/v1/key, and stop a batch before it runs into a 402.

What 429 and 503 ask of your client: read Retry-After, back off with jitter, cap the attempts, and know which errors are never worth retrying.

Every chat completion reports what it charged in usage.cost. Find it in a reply and a stream, log it per request and check the sums against the key route.

Why an API call comes back 402 payment_required: the prepaid balance, a key spend limit or an account ceiling. How to tell which, and what to do.
No posts match. Try another word, or pick a topic above.