openai/codex · error · ApiError

quota exceeded

Error message

quota exceeded

What it means

The API returned a quota-exhausted response for the account: usage is rejected until the quota window resets or the limit is raised. It is a non-retryable terminal condition distinct from transient rate limits.

Solutions

  1. Wait for the quota window to reset
  2. Upgrade the plan or increase limits
  3. Reduce request volume
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at codex-rs/codex-api/src/error.rs:17 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/8ee66b08b085b5fc. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/codex-api/src/error.rs:17

use crate::rate_limits::RateLimitError;
use codex_client::TransportError;
use http::StatusCode;
use std::time::Duration;
use thiserror::Error;

#[derive(Debug, Error)]
pub enum ApiError {
    #[error(transparent)]
    Transport(#[from] TransportError),
    #[error("api error {status}: {message}")]
    Api { status: StatusCode, message: String },
    #[error("stream error: {0}")]
    Stream(String),
    #[error("context window exceeded")]
    ContextWindowExceeded,
    #[error("quota exceeded")]
    QuotaExceeded,
    #[error("usage not included")]
    UsageNotIncluded,
    #[error("retryable error: {message}")]
    Retryable {
        message: String,
        delay: Option<Duration>,
    },
    #[error("rate limit: {0}")]
    RateLimit(String),
    #[error("invalid request: {message}")]
    InvalidRequest { message: String },
    #[error("cyber policy: {message}")]
    CyberPolicy { message: String },
    #[error("misalignment policy violation: {message}")]
    MisalignmentPolicyViolation { message: String },
    #[error("server overloaded")]
    ServerOverloaded,

View on GitHub (pinned to 339751715c)