Expose explicit model-to-rate-limit bucket mapping through app-server

Open
#36,432 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
api, backend

Research direction

Start with codex-rs/app-server/src/request_processors/account_processor.rs and the account/rateLimits/read schema, including its rateLimitsByLimitId snapshots. Trace how model catalog entries and backend limit_id values are exposed, then define and document an explicit join while preserving existing fields; done means selectable models have supported shared or model-specific mappings without name inference or quota consumption.

Written by the indexing model from the issue text.

Description

app-server enhancement rate-limits
What variant of Codex are you using?

Codex App / CLI app-server

What feature would you like to see?

Problem

Codex already exposes structured quota snapshots through account/rateLimits/read. The current implementation also returns rateLimitsByLimitId, including additional model-specific buckets when the backend provides them.

The missing piece is a supported mapping from selectable model IDs to the quota bucket or buckets that apply to them.

For example, public reports show a model-specific bucket such as:

  • model: gpt-5.3-codex-spark
  • limit ID: codex_bengalfox
  • limit name: GPT-5.3-Codex-Spark

A client can display the returned buckets, but it should not need to hard-code that opaque limit ID or infer model applicability from limitName. This becomes especially ambiguous when a model consumes both a shared Codex bucket and a model-specific bucket.

Requested feature

Expose an explicit model-to-rate-limit mapping through a supported app-server schema.

Two possible shapes:

  1. Add quota bucket IDs to each model returned by the model catalog:
{
  "id": "gpt-5.3-codex-spark",
  "rateLimitBucketIds": ["codex", "codex_bengalfox"]
}
  1. Or add model applicability to each entry in account/rateLimits/read:
{
  "rateLimitsByLimitId": {
    "codex_bengalfox": {
      "limitId": "codex_bengalfox",
      "limitName": "GPT-5.3-Codex-Spark",
      "appliesToModels": ["gpt-5.3-codex-spark"],
      "primary": { "usedPercent": 25, "resetsAt": 1730947200 }
    }
  }
}

The exact schema is open for discussion. The important requirement is that clients can join the model catalog to quota snapshots without private endpoint knowledge or hard-coded bucket names.

Expected behavior

  • Existing rateLimits and rateLimitsByLimitId fields remain backward compatible.
  • Every selectable ChatGPT-authenticated model can be associated with its effective shared and/or model-specific quota buckets.
  • Shared buckets identify all applicable models, or the model catalog explicitly references the shared bucket.
  • Unknown or unavailable mappings are represented explicitly rather than inferred from display names.
  • Desktop, IDE, CLI, and custom app-server clients can show the correct remaining quota and reset time before model selection.
  • Reading the mapping does not consume model quota.

Why this is useful

This enables accurate model pickers, low-quota warnings, quota-aware fallback, and agent safety policies while keeping rate-limit accounting and model routing owned by Codex.

Additional information

Existing foundation:

  • account/rateLimits/read already exposes structured snapshots and rateLimitsByLimitId.
  • codex-rs/app-server/src/request_processors/account_processor.rs indexes backend snapshots by limit_id.
  • The TUI already forwards additional snapshots from rateLimitsByLimitId.

Related but not duplicate:

  • #20310 requests CLI/SDK access to usage status.
  • #24927 requests agent-accessible quota safety policies.
  • #23150 and #33216 demonstrate the model-specific Spark bucket and the need to distinguish it from the shared Codex bucket.

This request is specifically for a supported model ID ↔ quota bucket mapping.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.