Quota Management

Control how much your API Keys and account can spend by creating reusable quota rule templates.

Control how much your API Keys and account can spend by creating reusable quota rule templates. Each rule defines a spending limit and optional time window — apply it to individual keys or as your account default.

Quota management/placeholders/docs/guide/quota-management.png


Why Use Quota Rules

  • Prevent overspend — cap daily, weekly, or monthly credit usage per key. Once the limit is hit, requests are rejected for the rest of the period.
  • Separate environments — assign a low daily limit to your dev key for safety, while keeping the production key unrestricted.
  • Restrict usage hours — only allow API calls during working hours, such as Monday to Friday 08:00–20:00, to avoid overnight runaway scripts.

How Rules Work

Rules follow a clear priority chain:

API Key rule (if set) → account default rule (if set) → no restriction
  • An API Key bound to a rule uses that rule directly.
  • Keys without a dedicated rule inherit the account default rule.
  • If neither is set, the key has no spending or time restrictions.

Creating a Rule

Click + Create Quota Rule to open the edit panel.

Create quota rule/placeholders/docs/guide/create-quota-rule.png

Basic Information

  • Rule Name — give it a recognizable name, such as Development key limit.
  • Description — optional note explaining when this rule should apply.
  • Enable Rule — toggle on or off. Disabled rules are kept for reference but will not appear as binding suggestions.

Quota Limit

  • Enable Quota Limit — turn on to enforce a spending cap. Once the credit limit is reached, requests are rejected for the remainder of the current period.
  • Quota Period — choose Daily, Weekly, or Monthly. The counter resets at the start of each period.
  • Quota Limit — maximum credits allowed per period. The value is always in credits.

Time Window

  • Enable Time Window — turn on to restrict when this rule is active. Outside the allowed window, requests are blocked.
  • Timezone — select the timezone this rule applies to, such as UTC+8.
  • Allowed Weekdays — check the days when the rule allows API calls.
  • Allowed Hours — set a time range in HH:MM-HH:MM format, such as 08:00-20:00.

Rule Preview

The preview panel at the bottom of the editor shows exactly what your rule will look like in plain text — review it before submitting.


Where to Bind Rules

Bind to an API Key

Go to API Key Manager, find the target key, and click Bind Rule in its row. Select a rule from the dropdown, or choose Inherit from account default to use the account-level setting.

Set Account Default

Go to Personal Settings, find the Default Quota Rule card, and select a rule as your account-wide default. All keys without their own rule will inherit it.

Default quota rule/placeholders/docs/guide/default-quota-rule.png


Managing Existing Rules

The rule list shows all your created templates:

ColumnDescription
Rule NameThe name you gave the rule
Quota LimitPeriod and credit cap
Time WindowAllowed days and hours, with timezone
StatusEnabled or disabled
Reference CountHow many keys are currently using this rule
ActionsEdit, enable, or disable

A rule with active references can still be edited. Changes take effect immediately on all bound keys.