Description
RateLimitPolicy — the only surface that can target a team, member, or team_member — has PolicyWindow = Second | Minute | Hour, with no Day. RateLimit, which does support tpd, attaches only to ApiKey and Model, never to a team.
The result: a per-day token quota works fine on a key or a model, but cannot be expressed for a team at all.
The counters already exist end to end — token_dims, KeyState, and both Redis Lua scripts all handle tpd — so the change is:
- add a
Day variant to PolicyWindow;
- add the match arm in
policy_to_rate_limit;
- relax the control plane's
validateRateLimitWindowTokens allowlist from {minute} to {minute, day}.
It does alter a published API surface (openapi/cp-admin.yaml) and needs a spec regen.
Scope note: per-second and per-hour token caps are deliberately excluded here — those are #396, which has a documented correctness reason for deferral and a genuinely different counter strategy. This issue is only the cheap, already-supported Day window.
Why
Daily is the period operators budget tokens in, and the team is the subject they budget for — so the one combination that cannot be configured is the one most often asked for.
A per-day team USD cap is expressible today via budgets (scope=team, period=day), which may cover the intent in some cases, but spend is not tokens.
Priority
Low — consistency fix, small and self-contained.
Prior art
TrueFoundry and Portkey express token × team × day directly; LiteLLM cannot.
Surveyed 2026-07-15; every claim rests on a fetched docs/source page.
Description
RateLimitPolicy— the only surface that can target a team,member, orteam_member— hasPolicyWindow=Second | Minute | Hour, with noDay.RateLimit, which does supporttpd, attaches only toApiKeyandModel, never to a team.The result: a per-day token quota works fine on a key or a model, but cannot be expressed for a team at all.
The counters already exist end to end —
token_dims,KeyState, and both Redis Lua scripts all handletpd— so the change is:Dayvariant toPolicyWindow;policy_to_rate_limit;validateRateLimitWindowTokensallowlist from{minute}to{minute, day}.It does alter a published API surface (
openapi/cp-admin.yaml) and needs a spec regen.Scope note: per-second and per-hour token caps are deliberately excluded here — those are #396, which has a documented correctness reason for deferral and a genuinely different counter strategy. This issue is only the cheap, already-supported
Daywindow.Why
Daily is the period operators budget tokens in, and the team is the subject they budget for — so the one combination that cannot be configured is the one most often asked for.
A per-day team USD cap is expressible today via budgets (
scope=team,period=day), which may cover the intent in some cases, but spend is not tokens.Priority
Low — consistency fix, small and self-contained.
Prior art
tpm_limitis per-minute only;budget_durationis USDtokens_per_day×team:subjectsTrueFoundry and Portkey express token × team × day directly; LiteLLM cannot.
Surveyed 2026-07-15; every claim rests on a fetched docs/source page.