Limits, Metering, and Costs
AI Gateway associates requests with API-key identities, measures usage by task, and applies configured prices. Internal teams focus on allowances and attribution; external pricing and payment workflows are covered in Operating Paid Model Services.
Distinguish the controls
| Concept | Meaning |
|---|---|
| Key spending allowance | The maximum monetary consumption for a key, not a top-up balance |
| Token usage or quota | Usage is consumption; a token-count limit is distinct from a monetary limit |
| TPM | Token usage per minute, separate from monthly or lifetime allowances |
| Account balance | Funds in the personal or organization account used for consumption |
Enter a monetary amount when setting a key’s spending allowance. The API Keys list shows the amount spent and the configured limit.
Set a key allowance
Create or edit a key under personal or organization API Keys, then choose:
- Unlimited: No monetary cap on this key. Requests are still charged at the service’s rates and subject to account balance, access permissions, and rate limits.
- Monthly allowance: Resets each calendar month. Requests using the key are rejected once the allowance is exhausted.
- Total allowance: Limits lifetime monetary consumption by the key.
Set an appropriate expiration as well. See API Keys. Each key has its own spending limit; organization cost attribution is described below.
Metering and pricing
| Task | Usage measurement |
|---|---|
| Chat | Input and output tokens tracked separately |
| Embeddings | Input token count |
| Audio | Duration, call count, or other task-specific units |
| Images | Call count or configured resolution tiers |
| Video | Call count or other service-specific units |
Calculate charges using the target service’s SKU and metering units. Check its pricing information for the applicable input, output, cache, and multimodal rates. When accounting for costs, record provider costs separately from customer-facing prices.
Personal and organization attribution
Personal-key consumption goes to personal billing. Organization-key consumption goes to organization billing. Choose the correct owner when creating a project key, then assign a recognizable application name.
Token-call charges are deducted from the corresponding account balance. Compute vouchers cannot be used for token-based API calls. See Compute voucher eligibility.
When reconciling charges, align time ranges and check key ownership, model name, units, the applicable price, and request outcomes. For failed or interrupted requests, check consumption records for any charges incurred.
Where to look
- API Keys list: Spending progress, allowance, and expiry.
- Personal or organization billing: Charges attributed to that identity.
- Endpoint billing: Resource consumption for a dedicated endpoint; see Using Endpoints.
- Consumption reports: Platform records in deployments with operating features; see Billing Administration.
For runtime metrics such as concurrency, traffic, and latency, see Monitoring, Logs, and Troubleshooting.