Skip to content
eddy.wijaya edited this page Apr 3, 2026 · 1 revision

πŸš€ Usage

How to use the /codex_quota command and codex_quota tool.


🎯 Quick Reference

Command Mode Use Case
/codex_quota Full User-facing β€” complete quota details
/codex_quota compact Compact Concise table β€” same as full but shorter
codex_quota(mode="compact") Compact Agent/tool call β€” inline quota check

πŸ‘€ Full Mode (User Command)

The default mode when you run /codex_quota:

/codex_quota

Shows complete quota details including plan type, primary 5h window, weekly window, code review quota, credits, spend control, and promotional info.

Example Output

# OpenAI Codex Subscription

**Plan:** Plus | **Account:** user@example.com

---

## Quota Limits

| Window | Usage | Progress | Resets At |
|--------|-------|----------|------------|
| **Primary (5h)** | 51% | `β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘` 51% | 04:06:26 |
| **Weekly** | 40% | `β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘` 40% | 05:46:54 on 9 Apr |

---

> ⚠️ Primary (5h) at 51% β€” consider pacing your usage.

---

## Code Review Quota

| Window | Usage | Progress | Resets At |
|--------|-------|----------|------------|
| **Weekly** | 0% | `β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘` 0% | 02:37:12 on 11 Apr |

---

## Spend Control

**Status:** βœ… Within limit

---

*Updated: 2026-03-29T12:00:00.000Z*

πŸ€– Compact Mode (Agent / Tool Call)

For concise output when called by an AI agent or via the slash command:

/codex_quota compact

Or directly as a tool call:

codex_quota(mode="compact")

Example Output

### Codex Quota β€” Plus

| Window | Usage | Progress | Resets At |
|--------|-------|----------|------------|
| 5h | 51% | `β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘` | 04:06:26 |
| Weekly | 40% | `β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘` | 05:46:54 on 9 Apr |

**Status**: βœ… Within limits

πŸ“Š Conditional Sections

Some sections appear only when relevant:

Section When Shown
Code Review Quota When your plan includes code review limits
Credits When you have credits or unlimited balance
Promotional When promotional quota is active
Warning banners When any window is 80–99% or 100%
Advisory notes When any window is 50–79%

⚠️ Warning Thresholds

Usage Level Behavior
0–49% Normal display, no warnings
50–79% Advisory note (blockquote with ⚠️)
80–99% Warning banner (blockquote with ⚠️)
100% Limit reached banner (blockquote with 🚫)
>100% Full bar, actual percentage shown, limit reached banner

πŸ”„ How /codex_quota Works

In current OpenCode plugin APIs:

/codex_quota
  β†’ wrapper prompt tells OpenCode to call tool.codex_quota
  β†’ AuthReader: auth.json β†’ JWT β†’ { token, accountId, email }
  β†’ ApiClient: GET wham/usage β†’ QuotaResponse
  β†’ Formatter: QuotaResponse + mode β†’ Markdown string
  β†’ OpenCode TUI renders via Glamour

Note: /codex_quota is LLM-mediated β€” it's a wrapper prompt that tells OpenCode to call the underlying tool. The tool returns raw Markdown which is rendered by the OpenCode TUI.


πŸ“– Next Steps

πŸ“š opencode-codex-quota

Getting Started

Reference

Development


GitHub Repository Β· npm Β· Issues

Clone this wiki locally