Skip to main content

rate_limit_is_explicit_null

Function rate_limit_is_explicit_null 

Source
pub fn rate_limit_is_explicit_null(json: &Value) -> bool
Expand description

True when the usage payload is a valid response that explicitly reports no active rate-limit window ("rate_limit": null).

The ChatGPT backend returns this when there is no usage recorded in the current window (and it transiently returned it for every account during an upstream incident). It is a benign “no data yet” state, not a malformed payload, so callers should degrade gracefully (serve cache / show n/a) rather than reporting an error. This mirrors the official codex client, which maps a null rate_limit to empty windows instead of failing.