features getting-started

Hard Monthly LLM Budget Caps per Team

· Updated · 6 min read

A hard monthly LLM budget cap per team means that once the team has used its allowance, further requests are rejected instead of billed. In VoidLLM you set a monthly_token_limit on the team, and the proxy returns HTTP 429 with token_limit_exceeded when the team’s tokens for the current UTC month reach it. The cap is in tokens, not currency, so you convert your budget to tokens with your model prices.

⚠Tokens and requests, not dollars

VoidLLM enforces limits in tokens (daily and monthly) and in requests per minute and per day. It does not stop traffic at a dollar amount. Dollar figures shown in usage views are estimates from the per-model prices you configure.

This post is about the enforcement side. For attribution and reporting see LLM Cost Allocation per Team and LLM Chargeback and Cost Attribution for Engineering Teams.

How it works in VoidLLM

Four levels, checked independently

Token and request limits can be set at four levels: organization, team, user and API key. Each has daily_token_limit, monthly_token_limit, requests_per_minute and requests_per_day. A value of 0 means unlimited at that level.

Every level is checked on every request, so the most restrictive limit anywhere in the hierarchy wins. With an org limit of 10,000 tokens per day, a team limit of 5,000, a user limit of 2,000 and a key limit of 1,000, that key can use 1,000 tokens per day. See the RBAC docs.

Set a team cap

# 300M tokens per month for the team
curl -X PATCH https://voidllm.example.com/api/v1/orgs/$ORG_ID/teams/$TEAM_ID \
  -H "Authorization: Bearer vl_uk_..." \
  -H "Content-Type: application/json" \
  -d '{"monthly_token_limit": 300000000}'

Add a daily limit next to it if you want to catch a runaway job before it eats the month:

curl -X PATCH https://voidllm.example.com/api/v1/orgs/$ORG_ID/teams/$TEAM_ID \
  -H "Authorization: Bearer vl_uk_..." \
  -H "Content-Type: application/json" \
  -d '{"daily_token_limit": 20000000, "monthly_token_limit": 300000000}'

The same fields exist on the org (PATCH /api/v1/orgs/{org_id}), on org memberships (PATCH /api/v1/orgs/{org_id}/members/{membership_id}) and on keys (PATCH /api/v1/orgs/{org_id}/keys/{key_id}, or at creation). Limits can also be edited in the admin UI. Changes take effect without a restart: key limit changes apply immediately, and team and org limit changes apply within seconds, at the next key-cache refresh (every 30 seconds by default).

Daily versus monthly

What happens when the cap is hit

The caller receives HTTP 429 with a JSON error:

{
  "error": {
    "code": "token_limit_exceeded",
    "message": "token budget exceeded",
    "request_id": "019d3ba2-8130-7d96-b60e-2e0da53e2650"
  }
}

Request-rate limits use rate_limit_exceeded instead, so clients can tell the two apart. Other teams, users and keys are unaffected. The rejection is counted in the Prometheus metrics (labelled token or request) and logged with the key and org ID. The limit lifts at the next window, or immediately when an admin raises it.

Note that a 429 from VoidLLM’s own limits is not retried on another deployment. Failover applies to upstream provider responses; see LLM Load Balancing and Failover Across Providers.

Turning a currency budget into a token budget

Pick the model mix, divide the budget by the blended price per million tokens, and set the result as the monthly limit. For example, with an illustrative blended price of 5 per million tokens, a budget of 1,500 corresponds to 300M tokens. Use your own contract prices, and leave headroom, because input and output tokens are priced differently and the mix changes.

Configure per-model prices so that the estimated cost in the usage views lines up with your assumption:

models:
  - name: gpt-4o
    provider: openai
    base_url: https://api.openai.com/v1
    api_key: ${OPENAI_KEY}
    pricing:
      input_per_1m: 2.50
      output_per_1m: 10.00

The prices above are examples only. Compare the estimate with the provider invoice for a month or two before relying on it.

Example layout

LevelMonthly tokensDaily tokensPurpose
Org500MnoneTotal ceiling
Team: Engineering300M20MTeam cap plus daily brake
Team: Marketing100M6MTeam cap
Key: backend-ci50MnoneContain a runaway script

A key that reaches 50M stops while Engineering continues. When Engineering reaches 300M, only Engineering stops. When the org total reaches 500M, everyone stops.

Limits to know about

Frequently asked questions

How do I set a hard monthly budget cap on LLM spend per team?

Set monthly_token_limit on the team (PATCH /api/v1/orgs/{org_id}/teams/{team_id}). Once the team's tokens for the current UTC calendar month reach the limit, further requests from that team are rejected with HTTP 429 and the error code token_limit_exceeded until the month rolls over or an admin raises the limit. VoidLLM caps tokens and requests, not currency, so convert your monthly budget to tokens using your model prices.

What is the difference between LLM budget management and a cost cap?

Budget management is the whole practice of allocating, tracking and limiting spend. A cost cap is the hard stop. In VoidLLM the hard stop is a token budget (daily or monthly) at org, team, user or key level, and tracking is done through usage records with an estimated cost from per-model prices.

How do I control LLM budgets for individual users and keys?

A user-level limit is set on the user's org membership and covers every key that user owns, including keys created later. A key-level limit applies to a single key, which is useful for scripts and CI. All levels are checked on each request and the most restrictive one wins. Limits are set by admins in the UI or the Admin API, and members cannot set limits on their own keys.

Does VoidLLM cap in dollars?

No. Limits are in tokens (daily and monthly) and in requests per minute and per day. Cost figures in the usage views are estimates calculated from the per-model prices you configure, so they are not a billing-grade number and are not enforced as a cap.

What happens to a request that is already running when the cap is reached?

It finishes. The budget is checked before a request starts, and the tokens are counted when the request is recorded. Requests already in flight when the cap is reached still complete, so usage can exceed the cap by up to what those requests consume. The next request is rejected.

Related posts