Billing and Limits

Understand token prices, credit reservation, reconciliation, and rate limits.

API calls use the same GLM 5 credits as Chat. There is no separate API wallet or API-only subscription balance.

Token prices

ModelInputOutput
glm-5.2$2.50 / 1M$7.50 / 1M
glm-5$1.50 / 1M$5.00 / 1M
kimi-k3$15.00 / 1M$75.00 / 1M
kimi-k2$1.50 / 1M$6.00 / 1M
deepseek-r1$1.75 / 1M$6.50 / 1M
deepseek-v4-pro$2.25 / 1M$4.50 / 1M
deepseek-v4-flash$0.70 / 1M$1.40 / 1M

Published API prices are translated into credits 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:

  1. 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.
  2. Send the request to the model.
  3. Read the provider-reported final input and output usage.
  4. Reconcile the reservation with the actual charge.
  5. 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 is not forwarded upstream. The provider selects its own default and GLM 5 reconciles the reservation against provider-reported usage.

Example estimate

For glm-5.2, a request with 50,000 input tokens and 1,000 output tokens has a published cost of:

input   = 50,000 / 1,000,000 × $2.50 = $0.1250
output  =  1,000 / 1,000,000 × $7.50 = $0.0075
total   = $0.1325
credits = ceil($0.1325 / $0.018) = 8

The actual charge uses provider-reported usage and is rounded up after conversion.

Insufficient balance

When the available balance cannot cover the reservation, the API returns:

{
  "error": {
    "message": "Insufficient credits.",
    "type": "insufficient_quota",
    "code": "insufficient_quota",
    "param": null
  }
}

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.