Spend Limits

Cap what each inference API key can spend — RPM limits, credit budgets, the none, daily, weekly and monthly reset windows, and what a 429 tells you.

Each inference key has two independent safety controls:

  • RPM limits requests per minute.
  • Spend limit caps credits for the selected reset window.

spend_reset accepts the lowercase values none, daily, weekly, and monthly. Any other value falls back to daily.

spend_resetBudget window
noneNever resets — the limit applies to everything the key has ever spent.
dailyResets at 00:00 UTC.
weeklyResets Monday 00:00 UTC.
monthlyResets on the 1st at 00:00 UTC.

spend_reset controls when the budget clears, not whether there is one. To run a key without a spend cap, set spend_limit to 0: that disables the user-side guard, and the account's API-eligible balance remains the hard billing limit.

rpm_limit accepts 1–300 and defaults to 60. A non-zero spend_limit accepts 1–100,000 credits and defaults to 300.

Settings → API Keys only exposes the daily credit limit and always sends spend_reset: "daily". Use the Management API to create a key with another reset window.

What happens before a request

GLM5 estimates the request cost, atomically reserves room in the key budget, and then reserves account credits. After the provider finishes, GLM5 settles both reservations using actual token usage. If the request fails before successful completion, the reservation is released so a failed call does not retain the full estimated charge.

When a limit is reached

The API returns HTTP 429 with code api_key_spend_limit_exceeded and fields describing the current window, required credits, remaining budget, and reset time when applicable.

Use Settings → API Keys to change limits. Use Disable for an immediate reversible stop; use Revoke only when the credential must never work again.