wandb/openui · warning · HTTPException
You've exceeded our usage quota, come back tomorrow to gener
Error message
You've exceeded our usage quota, come back tomorrow to generate more UI.
What it means
chat_completions enforces a daily usage quota in PROD: if a user's token usage in the last 24h (Usage.tokens_since) exceeds config.MAX_TOKENS, it raises HTTP 429 with the quota message. This protects the hosted service from runaway generation costs.
Source
Thrown at backend/openui/server.py:123
@router.post("/v1/chat/completions", tags=["openui/chat"])
@router.post(
"/chat/completions",
tags=["openui/chat"],
)
async def chat_completions(
request: Request,
# chat_request: CompletionCreateParams, # TODO: lots' fo weirdness here, just using raw json
# ctx: Any = Depends(weave_context),
):
if request.session.get("user_id") is None:
raise HTTPException(status_code=401, detail="Login required to use OpenUI")
user_id = request.session["user_id"]
yesterday = datetime.now() - timedelta(days=1)
tokens = Usage.tokens_since(user_id, yesterday.date())
if config.ENV == config.Env.PROD and tokens > config.MAX_TOKENS:
raise HTTPException(
status_code=429,
detail="You've exceeded our usage quota, come back tomorrow to generate more UI.",
)
try:
data = await request.json() # chat_request.model_dump(exclude_unset=True)
input_tokens = count_tokens(data["messages"])
# TODO: we always assume 4096 max tokens (random fudge factor here)
data["max_tokens"] = 4096 - input_tokens - 20
# TODO: refactor all these blocks into one once Ollama supports vision
# OpenAI Models
if data.get("model").startswith("gpt"):
if data["model"] == "gpt-4" or data["model"] == "gpt-4-32k":
raise HTTPException(status=400, data="Model not supported")
response: AsyncStream[
ChatCompletionChunk
] = await openai.chat.completions.create(
**data,
)View on GitHub (pinned to 42d7ab4ab6)
Solutions
- Wait until the 24h rolling window expires and usage drops below MAX_TOKENS.
- Run with config.ENV != PROD for development (quota check is skipped outside PROD).
- Raise config.MAX_TOKENS if you control the deployment.
- Track Usage.tokens_since client-side and throttle requests before hitting the cap.
Example fix
// before export ENV=PROD && python -m openui // after export ENV=DEV && python -m openui # quota check bypassed outside PROD
Defensive patterns
Strategy: retry
Validate before calling
# client-side quota pre-check if the endpoint exposes usage
usage = s.get('http://localhost:7878/usage').json()
if usage['tokens'] > MAX_TOKENS: raise RuntimeError('Quota exhausted for today') Try / catch
try:
r = s.post(url, json=payload)
if r.status_code == 429:
time.sleep(seconds_until_window_reset())
r = s.post(url, json=payload)
except requests.RequestException:
backoff_and_retry() Prevention
- Throttle generation requests and monitor daily token usage
- Use ENV=DEV for development work; reserve PROD quota
- Implement client-side backoff on 429 responses
- Avoid running bulk jobs against a shared account
When it happens
Trigger: Accumulating more than MAX_TOKENS of usage within one day in ENV=PROD, then calling chat completions again; the window is rolling from `datetime.now() - timedelta(days=1)`.
Common situations: Automated scripts/benchmarks hammering the endpoint; shared account used by a team; MAX_TOKENS left at the low default while doing heavy dev work in PROD mode.
Related errors
- Login required to use OpenUI
- Model not supported
- msg
- body.error.message
- Unexpected response ${r.status}: ${await r.text()}
AI-assisted analysis of wandb/openui@42d7ab4ab6 (2026-09-01).
Data as JSON: /api/errors/71deb3ae9f52df10.
Report an issue: GitHub.