You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(spend): per-API-key spend scope (spend.apiKey) and opt-in keys on loopback #6156
Context: we run agent fleets and a human's Codex through one ocx on 127.0.0.1. On loopback, keys are ignored by
design (auth-cors.ts isLoopbackRequestHost), so usage.jsonl rows carry apiKeyId=null. spend.{root,identity,pool}
cannot express "this client's budget".
Ask:
An opt-in config flag to require/resolve bearer keys on loopback too, so apiKeyId is recorded.
A spend scope keyed by API key: spend.apiKey..maxTokens (+ window), enforced like root/pool, refused with
the same error shape.
Admission checks for spend.identity / spend.pool on the forward path (openai-responses provider to another ocx):
today these scopes book after the fetch (alreadySent) and never refuse; only root has a pre-dispatch check, so
no daily or per-account cap is enforceable.
Workaround today: a second instance with its own OPENCODEX_HOME + port (per AGENTS_INSTALL.md) that forwards to the
first, with session_affinity_header mapping each agent session to a root alias. The per-session cap works (429 on
the second instance while the first returns 200), but there is no daily/pool cap and we run two ledgers.
Thanks for taking the time to submit this issue. It was closed automatically because it was not opened with a recognized issue template (Bug report, Feature request, Documentation, or Provider compatibility). Freeform and API-opened issues cannot skip this check.
This issue does not use a recognized issue template.
Please edit the issue to add:
Open a new issue with the Bug report, Feature request, Documentation, or Provider compatibility template.
Or edit this issue so the body uses the template section headings for the kind of report you are filing.
Activity
github-actions commentedon Sep 28, 2026
Issue closed: use an issue template
Thanks for taking the time to submit this issue. It was closed automatically because it was not opened with a recognized issue template (Bug report, Feature request, Documentation, or Provider compatibility). Freeform and API-opened issues cannot skip this check.
Please edit the issue to add:
See the Contributing guide for details.
Once the report passes the automated checks, it will be reopened automatically unless a maintainer has changed its state.