Read and set your credits in US dollars
Your account, monthly limit and organization keys now return US-dollar fields beside each credit amount, limits can be set in US dollars, and two out-of-credits refusals now say credits.
Your account, your monthly limit and your organization keys now return a US-dollar field beside each credit amount, and the limits below take a US-dollar amount. Read and set them in the same dollars the dashboard shows, with no unit conversion in your code.

Fields in US dollars
| Endpoint | New fields |
|---|---|
GET /api/user/self | quota_usd (credits left), used_quota_usd |
GET /api/user/monthly_limit | monthly_quota_limit_usd, monthly_quota_used_usd, allocated_to_tokens_usd, unallocated_usd |
GET /api/orgs/:id/tokens | credit_limit_usd, credit_used_usd, credit_remaining_usd |
A null monthly_quota_limit_usd or credit_limit_usd means no limit.
Set limits in US dollars
| Where | Field |
|---|---|
PUT /api/user/monthly_limit | monthly_quota_limit_usd |
| A key's spend caps | spend_limit_usd_per_day, spend_limit_usd_per_week |
| An organization key | credit_limit_usd |
Send the US-dollar field or the field it sits beside, not both. Both in one request is refused with quota_and_usd_both_set; a malformed, negative or oversized amount is refused with invalid_usd_amount. The existing fields keep their names and values, so an integration that reads them needs no change.
Refusals say credits
Two out-of-credits refusals now name credits. Each keeps the HTTP status and error code it had before:
| What ran out | Message |
|---|---|
| Your account's credits do not cover the request | insufficient credits |
| The key's remaining credits do not cover it | the API key's remaining credits do not cover this request |

When an auto top-up starts, insufficient credits is followed by a note saying so, so match on the start of the message. Error codes, HTTP statuses and error response fields are unchanged, so code that matches on them keeps working. Subscription emails and messages now call a plan's monthly units its plan allowance. The fields are documented in billing and credits and the refusals in error codes.