Credits Quota Management

更新时间:
复制 MD 格式

The FinOps capability of AI Gateway allows you to set quota rules for consumers. This can help you manage costs and allocate resources.

Overview

The AI Gateway instance now includes FinOps capabilities, enabling instance-level quota rules for consumers. Quota rules limit the number of model invocations allowed for bound consumers by specifying: Quota type (Token-based or Credits-based), Quota limit, Reset cycle (daily, weekly, or monthly), and Time zone. When the quota limit is reached, consumers cannot invoke models until the next reset cycle begins.

The consumer quota feature supports:

  • Instance-level Token-based quota configuration,

  • Reset cycles aligned to natural day, week, or month,

  • Multiple concurrent quota rules across different dimensions—each decremented independently,

  • Time zone configuration per quota rule,

  • Manual quota reset, and

  • Quota utilization monitoring via a dedicated dashboard.

Prerequisite

  • An instance of AI gateway above 2.1.19. If you need to view Credits, please upgrade to 2.1.20.

  • The instance should not be Serverless type.

  • A consumer.

  • SLS service for quota stastics.

Note

The FinOps is used for total usage of credits. And traffic limitation is for QPS.

Create a quota rule

Use AI gateway console to manage quota of consumers.

  1. Under FinOps, on the Consumer Quota page, click Create Quota Rule.

  2. Configure the following settings.

Step 1: Basic Configuration

In the Basic Configuration step, configure the following parameters:

Parameter

Description

Rule Name

Enter a name for the quota rule. The name can be 1 to 64 characters in length and can contain letters, digits, hyphens (-), and underscores (_).

Rule Type

Select the quota dimension. Choose Token Quota to measure by token count, or Credits Quota to limit consumer usage by Credits instead of raw token count. The Quota Limit unit automatically switches to Credits when Credits Quota is selected.

Quota

Enter the maximum allowed consumption within each reset cycle. The value must be at least 1. The unit (Tokens or Credits) is displayed automatically based on the selected quota type.

Reset Period

Select how often the quota resets: Calendar Day, Calendar Week, or Calendar Month. This parameter cannot be modified after the rule is created.

Time Zone

Select the timezone for the reset cycle. The default is UTC+8. Available options include UTC+9 (Tokyo), UTC+8 (Beijing/Shanghai/Singapore/Hong Kong), UTC+7 (Bangkok), UTC+5:30 (New Delhi), UTC+3 (Moscow), UTC+1 (Berlin/Paris), UTC+0 (London), UTC-5 (New York), and UTC-8 (Los Angeles). This parameter cannot be modified after the rule is created.

Step 2: Select Consumer

In the Select Consumers section, use the transfer box to specify the consumers to which this quota rule applies.

  • The left list shows available consumers; the right list shows selected consumers.

  • Search by consumer name to filter quickly.

  • You can select up to 1,000 consumers in a single quota rule creation or edit.

  • A View link appears next to each selected consumer, opening that consumer's detail page.

For details on how quotas interact with authentication, see Consumer authentication.

Step 3: Review

One consumer could only have one credit rule in one rest period. If conflict happens, go back to consumer selections and adjust rules.

Edit Quota Rule

On the Consumer Quotas list page, locate the target quota rule and click Edit Quota Rule in the Actions column.

  • In edit mode, you cannot modify the Reset Cycle or Time Zone fields.

  • Use the transfer box to add or remove consumers from the consumer list.

  • After editing, the system runs conflict detection using the same process as during quota rule creation.

  • Once success, the page returns to the Quota Rules list and displays a success notification at the top.

Enable / Disable Quota Rule

Toggles the rule status. A confirmation dialog appears before the action. After enabling, the rule takes effect immediately. After disabling, the rule stops taking effect immediately.

Delete Quota Rule

Permanently removes the quota rule. You must type the rule name in the confirmation dialog to confirm deletion.

View rule details and usage statistics

Click a rule name on the Consumer Quota page to go to the rule details page. The details page contains two tabs:

Usage statistics

This tab provides a real-time view of each consumer's quota consumption.

The page is split into two panels:

  • Left panel: A searchable list of consumers associated with this rule. Each entry shows the consumer name/ID and a usage progress bar indicating the consumed amount versus the total limit. The usage amount and limit unit correspond to the quota dimension of the rule — Tokens for Token Quota, Credits for Credits Quota. A badge indicates whether the consumer has exceeded its quota (Over Limit) or is within the limit (Within Limit).

  • Right panel: After selecting a consumer from the left panel, detailed usage information is displayed. The displayed metrics depend on the quota dimension of the rule:

    • Token Usage/Credits Usage: Total consumptions.

    • Input Token/Input Credits: Input-direction consumption in the current cycle.

    • Output Token/Output Credits: Output-direction consumption in the current cycle.

    • Consumption Records table: Includes columns for Model Name, Input, Output, Total, and Consumption Time.

Rule details

This tab displays the configuration information for the quota rule:

  • Basic Information:

    • Quota: The configured limit value with its unit (Tokens or Credits).

    • Status: Whether the rule is enabled or disabled.

    • Rule Type: Token Quota or Credits Quota.

  • Effective Period:

    • Rule Type: Period Quota.

    • Reset Period: Daily, Weekly, or Monthly.

    • Time Zone: The configured timezone.

A list of consumers associated with this rule is also displayed on this tab, showing each consumer's current quota usage.

You can also perform Edit Quota Rule, Quota Reset, Enable / Disable, and Delete operations from buttons at the top of the details page.