Significant-Gravitas/AutoGPT · error · HTTPException

Rate limit reset is not available (credit system is disabled

Error message

Rate limit reset is not available (credit system is disabled).

What it means

HTTP 400 from POST /usage/reset (routes.py:1034). Even with a positive reset cost configured, the endpoint refuses to run when the platform-wide credit system is off (`settings.config.enable_credit` is False, defined in backend/util/settings.py:196). Spending credits is the whole mechanism of the reset, so a disabled credit system makes the endpoint meaningless and it fails fast with 400.

Source

Thrown at autogpt_platform/backend/backend/api/features/chat/routes.py:1034

async def reset_copilot_usage(
    user_id: Annotated[str, Security(auth.get_user_id)],
) -> RateLimitResetResponse:
    """Reset the daily CoPilot rate limit by spending credits.

    Allows users who have hit their daily cost limit to spend credits
    to reset their daily usage counter and continue working.
    Returns 400 if the feature is disabled or the user is not over the limit.
    Returns 402 if the user has insufficient credits.
    """
    cost = config.rate_limit_reset_cost
    if cost <= 0:
        raise HTTPException(
            status_code=400,
            detail="Rate limit reset is not available.",
        )

    if not settings.config.enable_credit:
        raise HTTPException(
            status_code=400,
            detail="Rate limit reset is not available (credit system is disabled).",
        )

    daily_limit, weekly_limit, tier = await get_global_rate_limits(
        user_id,
        config.daily_cost_limit_microdollars,
        config.weekly_cost_limit_microdollars,
    )

    if daily_limit <= 0:
        raise HTTPException(
            status_code=400,
            detail="No daily limit is configured — nothing to reset.",
        )

    # Check max daily resets.  get_daily_reset_count returns None when Redis
    # is unavailable; reject the reset in that case to prevent unlimited

View on GitHub (pinned to 9c8bb5550f)

Solutions

  1. Enable the credit system: set enable_credit=true (ENABLE_CREDIT) in backend settings/.env and restart.
  2. If credits are intentionally disabled, also set rate_limit_reset_cost=0 so the endpoint fails at the first guard with the generic message, and remove the reset affordance from the UI.
  3. Client-side: treat this 400 as permanent configuration, not retryable.

Example fix

# before
ENABLE_CREDIT=false   # backend/.env -> every /usage/reset call returns 400

# after
ENABLE_CREDIT=true
Defensive patterns

Strategy: validation

Validate before calling

// only offer paid reset when the platform runs the credit system
if (!platformConfig.enable_credit || usage.rate_limit_reset_cost <= 0) {
  hideResetUI();
}

Try / catch

try { await post('/chat/usage/reset'); } catch (e) { if (e.status === 400 && /credit system is disabled/.test(e.detail)) { hideResetUI(); return; } throw e; }

Prevention

When it happens

Trigger: POST to the usage-reset endpoint on a deployment where ENABLE_CREDIT=false in backend .env / settings. Reproduced in tests via mocker.patch.object(chat_routes.settings.config, "enable_credit", False) (routes_test.py:2600).

Common situations: Self-hosted or marketplace-style deployment that intentionally runs without the credit/billing system; env drift where .env overrides enable_credit to false but the copilot reset cost is still configured; staging environment copied from a no-billing template.

Related errors


AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14). Data as JSON: /api/errors/4b2fa37321354794. Report an issue: GitHub.