Billing and Limits
How GLM 5 API usage becomes credits — which credits the API can spend, the rates, reservation and reconciliation, insufficient balance, 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 paid, the Public API can use all credits earned through a purchase and referral rewards. Free trial and welcome credits remain web-app-only. API refunds also remain available to the API because they return credits reserved by an earlier API request.
| Credit source | Chat / Image / Video | Public API |
|---|---|---|
| Pay-as-you-go credit pack | Yes | Yes |
| Monthly subscription credits | Yes | Yes |
| API request refund credits | Yes | Yes |
| Yearly subscription credits | Yes | Yes |
| Trial / welcome credits | Yes | No |
| Referral reward credits | Yes | Yes, after first purchase |
/settings/apikeys shows the account balance available to the API. For an
unpaid account it is 0; after the first purchase it includes paid credits,
referral rewards, and API refunds, but not free trial or welcome credits.
API credit rates
| Model | Input | Output |
|---|---|---|
gpt-6-astra | 2,778 credits / 1M input | 13,889 credits / 1M output |
claude-fable-5.1 | 2,778 credits / 1M input | 13,889 credits / 1M output |
glm-5.3-flash | 5 credits / 1M input | 14 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 |
gpt-6-astra: requests with 272,000 or more input tokens are billed for the entire request at 5,556 credits / 1M input and 20,834 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-flash, 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 × $0.075 = $0.00375
output = 1,000 / 1,000,000 × $0.25 = $0.00025
total = $0.00400
credits = ceil($0.00400 / $0.018) = 1
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 its API-eligible (paid) credit 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.