---
title: Monthly Token Quotas & Metering per Tenant | APIkit
description: Automate per-tenant AI token metering, usage alerts, and monthly quota enforcement directly inside APIkit.
canonical: "https://apikit.ai/j/enforce-monthly-token-quotas-tenants"
modified: 2026-11-14
author: apikit.ai editorial team
source: "https://apikit.ai"
category: API Key Auth, Scopes & Quotas
category_url: "https://apikit.ai/j#group-api-auth-permissions"
---

# Meter and cap monthly token quotas per tenant

> Track exact prompt and completion token usage per workspace, warn at 80%, and enforce clean monthly caps without building Stripe metering pipelines.

## Prepared starting prompt

Each workspace on our platform gets 500k AI tokens per month. I need accurate per-tenant metering, 80% webhook alerts, and clean cap enforcement.

### Quick scenarios
- **Exact token accounting:** Track input, cached, and output tokens accurately per tenant key across all routed models.
- **80% threshold webhooks:** Fire a usage warning webhook when a workspace hits 80% of its monthly allocation.
- **Hard vs overage mode:** Choose between returning HTTP 402/429 at 100% or allowing metered overages cleanly.

- [Join the APIkit waitlist](https://apikit.ai/#waitlist-f73a0d)

## Steps to launch accurate tenant token metering

1. **Normalize credit weights by model** — Weight expensive frontier model tokens higher than compact model tokens in unified workspace credits.
2. **Expose current usage headers** — Return monthly remaining credits on responses or query a lightweight usage summary endpoint.
3. **Trigger proactive warning webhooks** — Notify workspaces at 75% and 90% usage before sudden cutoff breaks automated pipelines.
4. **Align reset dates to billing** — Configure quota reset cycles on calendar first-of-month or each tenant's anniversary day.

## How it works in practice

### Workspace Quota State

Workspace: ws_delta (Pro Plan: 500,000 credits/mo)
Used prior to call: 499,600
Incoming request cost: 850 credits

### Quota Enforcement & Usage Response

Allowed or Blocked per policy:
- Strict Cap -> 429 Quota Exceeded {"used":499600,"limit":500000,"reset_at":"2026-12-01T00:00:00Z"}
- Usage Webhook Fired -> billing.quota_reached (ws_delta)

SaaS margin protection runs continuously at the API edge without building custom Redis counters or token-aggregation cron jobs.

## Frequently Asked Questions

### How are different model prices handled inside one token quota?

You can meter raw tokens or define normalized credit multipliers so one frontier token counts fairly relative to compact models.

### Can I render a live AI usage bar in our app settings page?

Yes. Query the tenant usage endpoint or read response quota headers to render real-time progress meters.

### What happens when a customer buys an extra add-on pack?

Increment that workspace's quota ceiling programmatically via API and blocked calls resume immediately.

## Related tasks in this category

- [Issue scoped API keys per customer and environment](https://apikit.ai/j/issue-scoped-tenant-api-keys.md)
- [Rotate API keys smoothly with overlapping grace windows](https://apikit.ai/j/rotate-compromised-keys-grace-window.md)
- [Verify end-user JWT claims directly at your AI endpoint](https://apikit.ai/j/validate-end-user-jwt-tokens.md)
- [Lock internal AI endpoints to approved IP and CIDR ranges](https://apikit.ai/j/restrict-endpoint-access-ip-allowlist.md)
- [Configure exact CORS origin policies for browser clients](https://apikit.ai/j/configure-cors-origins-browser-calls.md)
- [Shield public unauthenticated AI forms from bot abuse](https://apikit.ai/j/protect-public-forms-abuse-shields.md)

---

*Published by **Wondel.ai sp. z o.o.** · [apikit.ai](https://apikit.ai) · [About](https://apikit.ai/about) · [Editorial Guidelines](https://apikit.ai/editorial) · [Contact](https://apikit.ai/contact) · [Wondel.ai Products](https://wondel.ai/products)*