Significant-Gravitas/AutoGPT · error · HTTPException

Rate limit reset is not available.

Error message

Rate limit reset is not available.

What it means

HTTP 400 from POST /usage/reset (reset_copilot_usage in backend/api/features/chat/routes.py:1028). The endpoint lets a user spend credits to reset their daily CoPilot cost limit, but the very first guard rejects the call when the server-side config value `rate_limit_reset_cost` is <= 0. The field lives in backend/copilot/config.py:375 where the docstring states '0 = disabled', so this is an intentionally disabled feature, not a transient fault.

Source

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

        },
        503: {
            "description": "Service Unavailable (Redis reset failed; credits refunded or support needed)"
        },
    },
)
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(

View on GitHub (pinned to 9c8bb5550f)

Solutions

  1. Set rate_limit_reset_cost to a positive value (default 500 cents/credits) in backend/copilot/config.py or via the corresponding env var, then restart the backend.
  2. If the feature is intentionally disabled, hide the reset button in the client (check the usage-status payload, which exposes rate_limit_reset_cost=0) instead of calling the endpoint.
  3. If you are the client developer, treat HTTP 400 with this detail as a permanent 'feature off' signal and stop retrying.

Example fix

# before (config disabled but endpoint still called)
await post('/chat/usage/reset')  # -> 400 "Rate limit reset is not available."

# after: enable in backend config
# backend/backend/copilot/config.py
rate_limit_reset_cost: int = Field(default=500, ge=0)

# or client-side: consult usage status first
if (usage.rate_limit_reset_cost > 0) await post('/chat/usage/reset')
Defensive patterns

Strategy: validation

Validate before calling

// before calling the reset endpoint, confirm the feature is priced
const usage = await getUsageStatus();
if (usage.rate_limit_reset_cost <= 0) {
  showNotice('Paid reset is disabled on this deployment');
} else {
  await post('/chat/usage/reset');
}

Try / catch

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

Prevention

When it happens

Trigger: Calling the rate-limit-reset endpoint on a deployment where COPILOT_RATE_LIMIT_RESET_COST (or the config default) is set to 0. In tests, mocker.patch.object(chat_routes.config, "rate_limit_reset_cost", 0) reproduces it exactly (routes_test.py:2587).

Common situations: Fresh local dev environment where the flag was zeroed to disable paid resets; production rollback that disabled the feature but the frontend still shows the 'reset for credits' button; misreading the config unit (credits/cents) and setting 0 intentionally.

Related errors


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