Guide
How to set AI spending limits per employee.
A shared company API key has no per-person limit: one runaway script or curious team can spend the month's budget. A gateway fixes this by giving each person their own key and counting every request against an allowance you set.
In short
- Put a gateway between employees and OpenAI, Anthropic or Gemini, and give each person their own key instead of the company key.
- Set an allowance in US dollars, tokens or requests, per person, per group, per tier, or as one company pool, reset by the minute, hour, day, week or month.
- At the limit, block the request (HTTP 429), only warn, or switch to a cheaper model. Doorman does all of this, self-hosted and free.
Options
Choose how the money is shared.
Several allowances can apply to the same request, and every one of them is enforced, so the tightest one wins.
- Same amount for everyone
- One allowance for everyone, with "each person gets this amount"
- A team budget
- A group allowance shared as one pool, or split per member
- By plan or seniority
- A tier with a monthly dollar or token cap
- One person
- A personal limit set on their user page
- One app or model API
- An allowance on that AI API only
Setup
Four steps in Doorman.
Connect providers
Add your company OpenAI, Anthropic, Gemini or Azure OpenAI key once. Employees never see it.
Check prices
Built-in prices cover current models. Add your negotiated rates, and any model without a price, so dollar limits count it.
Create allowances
Under AI → Allowances, pick who it applies to, the amount, the period and what happens at the limit.
Share keys
Each person creates a personal key on My AI and sees their allowance, what is left and when it resets.
At the limit
Block, warn or downgrade.
A blocked request gets a clear error with the allowance name and when it resets, so tools and people know what happened.
- Block: HTTP 429 with error AI004 and a Retry-After header
- Warn: the request goes through, with a warning header, from 80% by default
- Downgrade: the request is switched to a cheaper model you allow
HTTP/1.1 429 Too Many Requests
Retry-After: 2073600
{
"error_code": "AI004",
"error_message": "AI budget exceeded",
"budget": "Engineering monthly",
"period_resets_at": "2026-12-01T00:00:00Z"
}Know the limits
How the counting works.
- Soft limits
- The counter is checked before a request and charged with actual usage after it. Requests already in flight can take spend slightly past the limit.
- Unpriced models count as $0
- Dollar limits only count models with a price. Token and request limits count every model, and the dashboard flags unpriced ones.
- Fails open
- If the counter store is unavailable, requests continue and the problem is logged.
- UTC periods
- Daily, weekly and monthly allowances reset at midnight UTC.
FAQ
Common questions.
Can't find your answer? The documentation covers setup, operations, and the AI gateway in detail.
Read the documentationCan I limit spend per employee on the OpenAI dashboard?
OpenAI projects can have budgets, but one shared key still gives everyone the same pool. To limit each person, each person needs their own key that is counted separately, which is what a gateway provides.
Does a dollar limit include cached tokens?
Yes. Cache reads and writes are tracked separately and priced at the provider's cache rates, so they count toward dollar allowances at what they actually cost.
Can I just track usage without limits?
Yes. Many teams start with reporting only, see spend by person, team and model, and add allowances later.
Related
Keep reading.
See where your AI spend is going.
Start with usage tracking and no limits, then add the allowances your numbers call for.