{"record":{"id":"67570ffd631c56ae","repo":"Significant-Gravitas/AutoGPT","slug":"your-weekly-limit-is-also-reached-resetting-the-d","errorCode":null,"errorMessage":"Your weekly limit is also reached. Resetting the daily limit won't help.","messagePattern":"Your weekly limit is also reached\\. Resetting the daily limit won't help\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"warning","filePath":"autogpt_platform/backend/backend/api/features/chat/routes.py","lineNumber":1092,"sourceCode":"        # Verify the user is actually at or over their daily limit.\n        # (rate_limit_reset_cost intentionally omitted — this object is only\n        # used for limit checks, not returned to the client.)\n        usage_status = await get_usage_status(\n            user_id=user_id,\n            daily_cost_limit=daily_limit,\n            weekly_cost_limit=weekly_limit,\n            tier=tier,\n        )\n        if daily_limit > 0 and usage_status.daily.used < daily_limit:\n            raise HTTPException(\n                status_code=400,\n                detail=\"You have not reached your daily limit yet.\",\n            )\n\n        # If the weekly limit is also exhausted, resetting the daily counter\n        # won't help — the user would still be blocked by the weekly limit.\n        if weekly_limit > 0 and usage_status.weekly.used >= weekly_limit:\n            raise HTTPException(\n                status_code=400,\n                detail=\"Your weekly limit is also reached. Resetting the daily limit won't help.\",\n            )\n\n        # Charge credits.\n        credit_model = await get_user_credit_model(user_id)\n        try:\n            remaining = await credit_model.spend_credits(\n                user_id=user_id,\n                cost=cost,\n                metadata=UsageTransactionMetadata(\n                    reason=\"CoPilot daily rate limit reset\",\n                ),\n            )\n        except InsufficientBalanceError as e:\n            raise HTTPException(\n                status_code=402,\n                detail=\"Insufficient credits to reset your rate limit.\",","sourceCodeStart":1074,"sourceCodeEnd":1110,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/chat/routes.py#L1074-L1110","documentation":"HTTP 400 from POST /usage/reset (routes.py:1092). Even when the daily limit is exhausted, the endpoint checks the weekly limit too: if weekly usage >= weekly_limit, clearing the daily counter changes nothing because the weekly cap still blocks the user. The comment in source says 'Resetting the daily limit won't help.' The request is rejected before any credits are charged.","triggerScenarios":"User is at/over both daily and weekly cost limits (weekly_cost_limit_microdollars, default 5,000,000 = $5/week, resets Monday 00:00 UTC) and calls /usage/reset.","commonSituations":"End of a heavy week: user hit the weekly cap and keeps seeing the daily-limit error; UI only surfaces the daily message so users buy-reset in confusion; support loads on weekends before the Monday UTC reset.","solutions":["Wait for the weekly window to reset (Monday 00:00 UTC) — no paid reset can bypass it.","If the product allows, raise weekly_cost_limit_microdollars for the user's tier.","Client-side: when the usage status shows weekly exhaustion, show a weekly-reset countdown instead of the daily reset button to avoid the 400."],"exampleFix":"// before\n// only daily state checked in UI -> users at weekly cap still click reset\n\n// after — check both windows\nconst blocked = usage.daily.used >= usage.daily.limit\n  || usage.weekly.used >= usage.weekly.limit;\n{blocked && usage.weekly.used < usage.weekly.limit && <ResetButton />}","handlingStrategy":"validation","validationCode":"// check both windows before offering the paid daily reset\nconst u = await getUsageStatus();\nconst dailyExhausted = u.daily.used >= u.daily.limit;\nconst weeklyExhausted = u.weekly.used >= u.weekly.limit;\nif (dailyExhausted && !weeklyExhausted) await post('/chat/usage/reset');\nelse if (weeklyExhausted) showWeeklyResetCountdown();","typeGuard":null,"tryCatchPattern":"try { await post('/chat/usage/reset'); } catch (e) { if (e.status === 400 && /weekly limit/.test(e.detail)) { showWeeklyResetCountdown(); return; } throw e; }","preventionTips":["Always render the weekly cap alongside the daily one in limit UIs","Never offer a paid reset when the weekly cap is exhausted — it cannot help","Weekly window resets Monday 00:00 UTC; show that countdown"],"tags":["http","rate-limit","usage","credits","fastapi"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}