Area
Dashboard
What are you trying to accomplish?
When an xAI Grok account hits its weekly limit, I want to see whether that account still has a reset coupon and spend one without leaving the dashboard — the same way the Codex account pool already shows a ticket badge and a redemption dialog.
What prevents this today?
#4306 shipped the whole backend for this: a gRPC-Web client for prod_mc_billing.ConsumerUiSvc, a journaled idempotency ledger, GET /api/grok/reset-coupons, POST /api/grok/reset-coupons/consume, and ocx account grok-reset-coupons. The dashboard was explicitly out of scope there, so the Providers > xAI Grok > Accounts tab shows a weekly-limit bar at 100% and says nothing about the coupon that could reset it. The only way to see or spend one is the terminal.
What should OpenCodex do?
Each signed-in xAI account row should carry a ticket badge with its remaining coupon count, muted at zero and highlighted when a coupon is available. Clicking the badge should open a dialog that lists each coupon's validity window, names the coupon closest to expiry as the one that will be spent, and asks for confirmation before redeeming it.
The dialog must be honest about the outcome, because redemption is irreversible:
- A replayed redemption that settled as a failure arrives as HTTP 200 with
replayed: true and the original code. It must be reported as a failure, never as a completed reset.
- A redemption that times out has an unknown outcome — the route may still be executing it, and a record that is still
open re-executes on the next attempt. The dialog must stop posting and offer a re-read instead of a retry button.
- A ledger-capacity refusal and an identity mismatch need their own messages, and no message may claim a coupon was not consumed unless that is known.
Rows that cannot spend a coupon — an account needing re-authentication, an API-key xAI setup, any non-xAI provider — should show no badge and trigger no billing read.
Example usage or interface
Today:
$ ocx account grok-reset-coupons
restok_vpYDqo valid 2026-08-13 → 2026-09-13
Wanted, in Providers > xAI Grok > Accounts:
p***1@gmail.com [🎫 1] [Edit alias] [🗑]
Weekly limit 25% used
Clicking 🎫 1 opens "Grok reset coupons" listing Next to use · Valid from Aug 13, 2026 · Expires Sep 13, 2026 (1d left) with a "Use 1 coupon" button and a confirmation step.
Alternatives or workarounds
Running ocx account grok-reset-coupons --consume --yes in a terminal, which is what exists today. Folding the coupon count into the xAI quota probe would make the badge free to render, but it would spend a billing RPC on every quota refresh and needs a server change; that is worth doing later, not first.
Additional context
Backend: #4306. The dashboard mirrors the Codex reset-credit surface in gui/src/components/codex-account-pool-helpers.tsx and codex-account-reset-modal.tsx.
Checks
Area
Dashboard
What are you trying to accomplish?
When an xAI Grok account hits its weekly limit, I want to see whether that account still has a reset coupon and spend one without leaving the dashboard — the same way the Codex account pool already shows a ticket badge and a redemption dialog.
What prevents this today?
#4306 shipped the whole backend for this: a gRPC-Web client for
prod_mc_billing.ConsumerUiSvc, a journaled idempotency ledger,GET /api/grok/reset-coupons,POST /api/grok/reset-coupons/consume, andocx account grok-reset-coupons. The dashboard was explicitly out of scope there, so the Providers > xAI Grok > Accounts tab shows a weekly-limit bar at 100% and says nothing about the coupon that could reset it. The only way to see or spend one is the terminal.What should OpenCodex do?
Each signed-in xAI account row should carry a ticket badge with its remaining coupon count, muted at zero and highlighted when a coupon is available. Clicking the badge should open a dialog that lists each coupon's validity window, names the coupon closest to expiry as the one that will be spent, and asks for confirmation before redeeming it.
The dialog must be honest about the outcome, because redemption is irreversible:
replayed: trueand the original code. It must be reported as a failure, never as a completed reset.openre-executes on the next attempt. The dialog must stop posting and offer a re-read instead of a retry button.Rows that cannot spend a coupon — an account needing re-authentication, an API-key xAI setup, any non-xAI provider — should show no badge and trigger no billing read.
Example usage or interface
Today:
Wanted, in Providers > xAI Grok > Accounts:
Clicking
🎫 1opens "Grok reset coupons" listingNext to use · Valid from Aug 13, 2026 · Expires Sep 13, 2026 (1d left)with a "Use 1 coupon" button and a confirmation step.Alternatives or workarounds
Running
ocx account grok-reset-coupons --consume --yesin a terminal, which is what exists today. Folding the coupon count into the xAI quota probe would make the badge free to render, but it would spend a billing RPC on every quota refresh and needs a server change; that is worth doing later, not first.Additional context
Backend: #4306. The dashboard mirrors the Codex reset-credit surface in
gui/src/components/codex-account-pool-helpers.tsxandcodex-account-reset-modal.tsx.Checks