Area
Provider adapters
What are you trying to accomplish?
Let operators inspect and redeem Grok billing reset coupons (Codex-style usage-reset credits) directly through OpenCodex, using the xAI OAuth tokens already stored — no browser session.
What prevents this today?
OpenCodex only provides quota reset credit inspection and consumption for Codex/ChatGPT accounts (`/api/codex-auth/reset-credits`, `ocx account reset-credits`). Grok reset coupons are served by `prod_mc_billing.ConsumerUiSvc` over binary gRPC-Web and have no management API or CLI surface, so the only way to see or spend one is the grok.com web UI with devtools open.
What should OpenCodex do?
- Expose `GET /api/grok/reset-coupons?accountId=` to inspect remaining reset tokens and validity windows.
- Expose `POST /api/grok/reset-coupons/consume` to redeem one with durable UUIDv4 operation-id idempotency (journal before fetch; identical ids replay; foreign ids 409; exhausted ledger 503).
- Provide `ocx account grok-reset-coupons [--consume --yes --token-id ] [--operation-id ]` mirroring the `reset-credits` safety flags.
Example usage or interface
```bash
ocx account grok-reset-coupons
ocx account grok-reset-coupons --consume --yes --operation-id 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d
```
Alternatives or workarounds
Manually inspecting and redeeming coupons in a web browser using devtools network payloads.
Additional context
Contract verified live against `grok.com` (`GetRemainingResets` / `RedeemReset`): binary gRPC-Web framing (`application/grpc-web+proto`, 5-byte envelope), `Authorization: Bearer ` + `X-XAI-Token-Auth: xai-grok-cli`, no cookies. Response tokens carry `tokenId` plus validity start/end timestamps.
Checks
Area
Provider adapters
What are you trying to accomplish?
Let operators inspect and redeem Grok billing reset coupons (Codex-style usage-reset credits) directly through OpenCodex, using the xAI OAuth tokens already stored — no browser session.
What prevents this today?
OpenCodex only provides quota reset credit inspection and consumption for Codex/ChatGPT accounts (`/api/codex-auth/reset-credits`, `ocx account reset-credits`). Grok reset coupons are served by `prod_mc_billing.ConsumerUiSvc` over binary gRPC-Web and have no management API or CLI surface, so the only way to see or spend one is the grok.com web UI with devtools open.
What should OpenCodex do?
Example usage or interface
```bash
ocx account grok-reset-coupons
ocx account grok-reset-coupons --consume --yes --operation-id 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d
```
Alternatives or workarounds
Manually inspecting and redeeming coupons in a web browser using devtools network payloads.
Additional context
Contract verified live against `grok.com` (`GetRemainingResets` / `RedeemReset`): binary gRPC-Web framing (`application/grpc-web+proto`, 5-byte envelope), `Authorization: Bearer ` + `X-XAI-Token-Auth: xai-grok-cli`, no cookies. Response tokens carry `tokenId` plus validity start/end timestamps.
Checks