Billing and Limits
Understand API credit rates, reservation, reconciliation, and rate limits.
API calls draw on your single GLM 5 credit balance — there is no separate API wallet to top up.
Who can use the Public API
Public API access unlocks after the account completes its first successful purchase. Any purchase qualifies: a pay-as-you-go credit pack, monthly plan, or yearly plan.
Once the account is a paid account, the Public API uses the same full valid credit balance as chat, image and video. That includes any welcome or referral credits still remaining on the account. Before the first purchase, promotional credits can still be used in the web app but cannot be used to call the Public API.
/settings/apikeys shows the account balance available to the API. For an unpaid
account it is 0; after the first purchase it matches the account's full valid
credit balance.
API credit rates
| Model | Input | Output |
|---|---|---|
ox-alpha | 190 credits / 1M input | 190 credits / 1M output |
glm-5.3 | 78 credits / 1M input | 245 credits / 1M output |
glm-5.2 | 78 credits / 1M input | 245 credits / 1M output |
glm-5 | 84 credits / 1M input | 278 credits / 1M output |
kimi-k3 | 834 credits / 1M input | 4,167 credits / 1M output |
kimi-k2 | 84 credits / 1M input | 334 credits / 1M output |
deepseek-r1 | 98 credits / 1M input | 362 credits / 1M output |
deepseek-v4-pro | 126 credits / 1M input | 251 credits / 1M output |
deepseek-v4-flash | 39 credits / 1M input | 78 credits / 1M output |
The table shows the credits charged per 1 million input or output tokens. Dollar prices are secondary reference values available on hover.
100 credits = $1.80 of API usage. Internally, API usage is converted at
$0.018 per credit and rounded up, with a minimum charge of one credit for a
completed request.
Reservation and reconciliation
GLM 5 uses a two-stage billing flow:
- Estimate input tokens and reserve credits for the requested output maximum, or use an internal 8,192-token billing estimate when no maximum is supplied.
- Send the request to the model.
- Read the final input and output usage for the completed request.
- Reconcile the reservation with the actual charge.
- Return unused reserved credits.
If a request fails after reservation, the reservation is refunded.
The billing estimate is not a model limit
When max_completion_tokens is omitted, the 8,192-token reservation estimate
does not change the model's default output behavior. GLM 5 reconciles the
reservation against the final recorded usage.
Example estimate
For glm-5.3, a request with 50,000 input tokens and 1,000 output tokens is
calculated from the underlying API usage value and then deducted from the shared
credit balance:
input = 50,000 / 1,000,000 × $1.40 = $0.0700
output = 1,000 / 1,000,000 × $4.40 = $0.0044
total = $0.0744
credits = ceil($0.0744 / $0.018) = 5
The actual charge uses the final recorded usage and is rounded up after conversion.
Payment required and insufficient balance
Before the first successful purchase, the API returns HTTP 402 with
code: "payment_required" and a link to pricing.
After the account is paid, if the full account balance cannot cover the reservation, the API returns:
{
"error": {
"message": "Insufficient credits. This request needs about 23 credits, but your account balance is 16. Buy credits or a subscription at https://glm5.app/pricing.",
"type": "insufficient_quota",
"code": "insufficient_quota",
"param": null,
"required_credits": 23,
"current_credits": 16,
"api_eligible_credits": 16,
"total_credits": 16,
"api_ineligible_credits": 0,
"missing_credits": 7,
"recharge_url": "https://glm5.app/pricing"
}
}
For a paid account, current_credits, api_eligible_credits, and
total_credits all reflect the same full valid account balance;
api_ineligible_credits is 0.
The HTTP status is 402.
Rate limits
The default limit is 60 requests per minute for each API key. A key can have a custom limit.
Exceeding the limit returns HTTP 429 with code rate_limit_exceeded.
Use exponential backoff with jitter. Do not immediately retry quota, authentication, or validation errors.
Body limit
POST /chat/completions accepts request bodies up to 4 MB. Larger requests
return HTTP 413 request_too_large.