Repository navigation
Description
Summary
When the monthly included usage quota of a Command Code Max subscription is exhausted, the Provider API returns HTTP 400 Bad Request, rather than an actionable quota-limit response such as HTTP 429 Too Many Requests.
This breaks automatic cooldown and account rotation in third-party AI clients/gateways that interpret 429 as temporary quota exhaustion and 400 as an invalid request.
Observed behavior
- Plan: Max
- Exhausted allowance: monthly subscription quota, not a 5-hour or weekly usage window
- Observed HTTP status: 400
- Effect: The client cannot detect the monthly exhaustion through its standard HTTP 429 cooldown handling.
I am reporting the actual HTTP status observed on my Max account; I have not included an unverified response body or guessed a reset timestamp.
Steps to reproduce
- Authenticate to the Command Code Provider API with an API key from a Max subscription.
- Exhaust the Max subscription's monthly included quota.
- Send another otherwise-valid model request.
- Observe an HTTP 400 response instead of a quota-limit response that an API client can use to initiate cooldown.
Expected behavior
- Use HTTP 429 for temporary monthly subscription quota exhaustion, consistent with the existing 429
RATE_LIMITEDbehavior reported for other subscription usage windows, rather than treating a valid request as a 400 Bad Request. - Return a stable machine-readable error code distinguishing monthly subscription quota exhausted from transient RPM/TPM rate limiting, upstream availability, and malformed requests.
- Expose the actual renewal/reset time in machine-readable form, preferably an absolute UTC reset timestamp and/or a standard
Retry-Afterheader. For a monthly quota this may be days or weeks away; clients must not retry every few seconds. - Apply consistent HTTP status and recovery semantics to OpenAI-compatible and Anthropic-compatible Provider API routes, while preserving each API's appropriate JSON error envelope.
- If the quota is not automatically replenished (e.g., a separate purchased-credit balance), expose a distinct terminal error instead of suggesting a short cooldown. This report concerns automatically renewing Max monthly quota.
Why this matters
Many clients and API gateways make fallback and cooldown decisions based on HTTP status codes:
- 400 → invalid request; no account cooldown.
- 429 → rate/quota limit; temporarily disable the affected account and retry or route elsewhere, ideally until
Retry-After/ reset time. - 5xx → transient server-side failure.
As a result, returning 400 for a monthly subscription limit prevents automatic cooldown for potentially the entire remainder of the billing period.
Related reports
- Billing API reports a healthy account while every request 400s with insufficient credits #1081 reports a related Provider API behavior: exhausted included monthly credits can reject completions with HTTP 400
BAD_REQUEST. That issue primarily focuses on billing API health/credit indicators. This issue focuses specifically on HTTP error classification and the cooldown contract for Max monthly subscription quotas. - Other community integrations have observed HTTP 429
RATE_LIMITEDfor 5-hour/weekly subscription windows: [Bug] Command Code GOAT:一次与账号无关的 429 被记成“账号不可用”,导致流量被改派且长期不回 klarkxy/open-console-gateway#62
Request
Could the team make monthly subscription quota exhaustion (including Max) a reliably machine-detectable, time-bound quota error, preferably HTTP 429 with a stable error code and actual reset time? This would let standard third-party clients stop routing to the exhausted account and recover automatically when the monthly quota renews.
Activity
vipulgupta2048 commentedon Nov 17, 2026
Confirmed. 5-hour and weekly limits already return 429, but an exhausted monthly quota returned 400 Bad Request, so gateways never cooled the key down. Fix in review: on
/v1/chat/completions,/v1/responsesand/v1/messages, an exhausted monthly quota now returns 429insufficient_quotawithx-should-retry: false. Purchased and free credits running out still return 400 — https://github.com/CommandCodeAI/commandcode/pull/6803