@slkiser/opencode-quota 3.2.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +278 -557
- package/dist/bin/opencode-quota.d.ts.map +1 -1
- package/dist/bin/opencode-quota.js +6 -0
- package/dist/bin/opencode-quota.js.map +1 -1
- package/dist/lib/anthropic.js +1 -1
- package/dist/lib/anthropic.js.map +1 -1
- package/dist/lib/cli-show.d.ts +8 -0
- package/dist/lib/cli-show.d.ts.map +1 -0
- package/dist/lib/cli-show.js +178 -0
- package/dist/lib/cli-show.js.map +1 -0
- package/dist/lib/config-file-utils.d.ts +13 -0
- package/dist/lib/config-file-utils.d.ts.map +1 -1
- package/dist/lib/config-file-utils.js +33 -0
- package/dist/lib/config-file-utils.js.map +1 -1
- package/dist/lib/config.d.ts +16 -3
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +452 -216
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/copilot.d.ts.map +1 -1
- package/dist/lib/copilot.js +3 -2
- package/dist/lib/copilot.js.map +1 -1
- package/dist/lib/entries.d.ts +3 -2
- package/dist/lib/entries.d.ts.map +1 -1
- package/dist/lib/format-utils.d.ts.map +1 -1
- package/dist/lib/format-utils.js +3 -2
- package/dist/lib/format-utils.js.map +1 -1
- package/dist/lib/format.d.ts.map +1 -1
- package/dist/lib/format.js +4 -2
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/google-gemini-cli-companion.d.ts +29 -0
- package/dist/lib/google-gemini-cli-companion.d.ts.map +1 -0
- package/dist/lib/google-gemini-cli-companion.js +166 -0
- package/dist/lib/google-gemini-cli-companion.js.map +1 -0
- package/dist/lib/google-gemini-cli.d.ts +48 -0
- package/dist/lib/google-gemini-cli.d.ts.map +1 -0
- package/dist/lib/google-gemini-cli.js +447 -0
- package/dist/lib/google-gemini-cli.js.map +1 -0
- package/dist/lib/grouped-entry-normalization.js +1 -1
- package/dist/lib/grouped-entry-normalization.js.map +1 -1
- package/dist/lib/init-installer.js +2 -2
- package/dist/lib/opencode-config-providers.d.ts +6 -0
- package/dist/lib/opencode-config-providers.d.ts.map +1 -0
- package/dist/lib/opencode-config-providers.js +79 -0
- package/dist/lib/opencode-config-providers.js.map +1 -0
- package/dist/lib/opencode-go.d.ts +5 -4
- package/dist/lib/opencode-go.d.ts.map +1 -1
- package/dist/lib/opencode-go.js +32 -18
- package/dist/lib/opencode-go.js.map +1 -1
- package/dist/lib/provider-metadata.d.ts +1 -1
- package/dist/lib/provider-metadata.d.ts.map +1 -1
- package/dist/lib/provider-metadata.js +19 -0
- package/dist/lib/provider-metadata.js.map +1 -1
- package/dist/lib/provider-model-matching.d.ts +12 -0
- package/dist/lib/provider-model-matching.d.ts.map +1 -0
- package/dist/lib/provider-model-matching.js +23 -0
- package/dist/lib/provider-model-matching.js.map +1 -0
- package/dist/lib/quota-render-data.d.ts +4 -0
- package/dist/lib/quota-render-data.d.ts.map +1 -1
- package/dist/lib/quota-render-data.js +4 -1
- package/dist/lib/quota-render-data.js.map +1 -1
- package/dist/lib/quota-runtime-context.d.ts +43 -0
- package/dist/lib/quota-runtime-context.d.ts.map +1 -0
- package/dist/lib/quota-runtime-context.js +62 -0
- package/dist/lib/quota-runtime-context.js.map +1 -0
- package/dist/lib/quota-state.d.ts +1 -0
- package/dist/lib/quota-state.d.ts.map +1 -1
- package/dist/lib/quota-state.js +18 -4
- package/dist/lib/quota-state.js.map +1 -1
- package/dist/lib/quota-status.d.ts +18 -1
- package/dist/lib/quota-status.d.ts.map +1 -1
- package/dist/lib/quota-status.js +106 -22
- package/dist/lib/quota-status.js.map +1 -1
- package/dist/lib/toast-format-grouped.d.ts.map +1 -1
- package/dist/lib/toast-format-grouped.js +5 -3
- package/dist/lib/toast-format-grouped.js.map +1 -1
- package/dist/lib/tui-config-diagnostics.d.ts +7 -2
- package/dist/lib/tui-config-diagnostics.d.ts.map +1 -1
- package/dist/lib/tui-config-diagnostics.js +27 -8
- package/dist/lib/tui-config-diagnostics.js.map +1 -1
- package/dist/lib/tui-runtime.d.ts.map +1 -1
- package/dist/lib/tui-runtime.js +25 -16
- package/dist/lib/tui-runtime.js.map +1 -1
- package/dist/lib/types.d.ts +55 -9
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +1 -0
- package/dist/lib/types.js.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +423 -159
- package/dist/plugin.js.map +1 -1
- package/dist/providers/chutes.d.ts.map +1 -1
- package/dist/providers/chutes.js +2 -4
- package/dist/providers/chutes.js.map +1 -1
- package/dist/providers/copilot.d.ts.map +1 -1
- package/dist/providers/copilot.js +5 -10
- package/dist/providers/copilot.js.map +1 -1
- package/dist/providers/cursor.js +2 -2
- package/dist/providers/cursor.js.map +1 -1
- package/dist/providers/google-account-format.d.ts +6 -0
- package/dist/providers/google-account-format.d.ts.map +1 -0
- package/dist/providers/google-account-format.js +21 -0
- package/dist/providers/google-account-format.js.map +1 -0
- package/dist/providers/google-antigravity.d.ts.map +1 -1
- package/dist/providers/google-antigravity.js +7 -29
- package/dist/providers/google-antigravity.js.map +1 -1
- package/dist/providers/google-gemini-cli.d.ts +3 -0
- package/dist/providers/google-gemini-cli.d.ts.map +1 -0
- package/dist/providers/google-gemini-cli.js +63 -0
- package/dist/providers/google-gemini-cli.js.map +1 -0
- package/dist/providers/minimax-coding-plan.js +2 -2
- package/dist/providers/minimax-coding-plan.js.map +1 -1
- package/dist/providers/nanogpt.d.ts.map +1 -1
- package/dist/providers/nanogpt.js +2 -2
- package/dist/providers/nanogpt.js.map +1 -1
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/providers/openai.js +2 -4
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/opencode-go.d.ts +2 -2
- package/dist/providers/opencode-go.d.ts.map +1 -1
- package/dist/providers/opencode-go.js +60 -11
- package/dist/providers/opencode-go.js.map +1 -1
- package/dist/providers/registry.d.ts.map +1 -1
- package/dist/providers/registry.js +2 -0
- package/dist/providers/registry.js.map +1 -1
- package/dist/providers/synthetic.d.ts.map +1 -1
- package/dist/providers/synthetic.js +2 -4
- package/dist/providers/synthetic.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,90 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</td>
|
|
26
|
-
</tr>
|
|
27
|
-
<tr>
|
|
28
|
-
<td width="100%" align="center">Example of TUI sidebar</td>
|
|
29
|
-
</tr>
|
|
30
|
-
</table>
|
|
31
|
-
|
|
32
|
-
<table>
|
|
33
|
-
|
|
34
|
-
<tr>
|
|
35
|
-
<td width="50%">
|
|
36
|
-
<img src="https://shawnkiser.com/opencode-quota/toast.webp" alt="Image of opencode-quota toast" />
|
|
37
|
-
</td>
|
|
38
|
-
<td width="50%">
|
|
39
|
-
<img src="https://shawnkiser.com/opencode-quota/token.webp" alt="Image of opencode-quota /tokens_weekly output" />
|
|
40
|
-
</td>
|
|
41
|
-
</tr>
|
|
42
|
-
<tr>
|
|
43
|
-
<td width="50%" align="center">Example of popup toast</td>
|
|
44
|
-
<td width="50%" align="center">Example of <code>/tokens_weekly</code></td>
|
|
45
|
-
</tr>
|
|
46
|
-
</table>
|
|
47
|
-
|
|
48
|
-
OpenCode `>= 1.4.3` is required.
|
|
49
|
-
|
|
50
|
-
If you are coming back later:
|
|
51
|
-
|
|
52
|
-
- see [Provider Setup At A Glance](#provider-setup-at-a-glance) for provider-specific setup needs
|
|
53
|
-
- see [Commands](#commands) for the slash commands
|
|
54
|
-
- see [Configuration Reference](#configuration-reference) when you want to customize behavior
|
|
55
|
-
- see [Troubleshooting](#troubleshooting) if something does not appear or auto-detect correctly
|
|
56
|
-
|
|
57
|
-
## Installation
|
|
58
|
-
|
|
59
|
-
### Automatic setup (recommended)
|
|
60
|
-
|
|
61
|
-
```sh
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/slkiser/opencode-quota">
|
|
3
|
+
<picture>
|
|
4
|
+
<source srcset="opencode-quota-logo-dark.svg" media="(prefers-color-scheme: dark)">
|
|
5
|
+
<source srcset="opencode-quota-logo-light.svg" media="(prefers-color-scheme: light)">
|
|
6
|
+
<img src="opencode-quota-logo-light.svg" alt="OpenCode Quota logo">
|
|
7
|
+
</picture>
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
10
|
+
<p align="center">Quota, usage, and token visibility for OpenCode.</p>
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/@slkiser/opencode-quota"><img alt="npm" src="https://img.shields.io/npm/v/%40slkiser%2Fopencode-quota?style=flat-square" /></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/@slkiser/opencode-quota"><img alt="npm downloads" src="https://img.shields.io/npm/dm/%40slkiser%2Fopencode-quota?style=flat-square" /></a>
|
|
14
|
+
<a href="https://github.com/slkiser/opencode-quota/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/slkiser/opencode-quota/ci.yml?style=flat-square&branch=main&label=CI" /></a>
|
|
15
|
+
<a href="./LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square" /></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
[](https://github.com/slkiser/opencode-quota)
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
### Installation (automatic setup)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
62
25
|
npx @slkiser/opencode-quota init
|
|
63
26
|
```
|
|
64
27
|
|
|
65
|
-
|
|
28
|
+
> [!IMPORTANT]
|
|
29
|
+
> OpenCode `>= 1.4.3` and Node.js `>= 18` are required.
|
|
66
30
|
|
|
67
|
-
-
|
|
68
|
-
- **Quota UI**: `Toast`, `Sidebar`, `Toast + Sidebar`, or `None (manual /quota and /tokens_* only)`
|
|
69
|
-
- **Provider mode**: `Auto-detect` or `Manual select`
|
|
70
|
-
- **Quota display style**: `Single window` (show the most constrained quota window for each provider) or `All windows`
|
|
71
|
-
- **Percent display (toast/sidebar only)**: `remaining` or `used`
|
|
72
|
-
- **Show session input/output tokens**: `Yes` or `No`
|
|
31
|
+
The installer is append-only and preserves existing config values. It asks where to install, which quota UI to enable, whether providers should be auto-detected, which quota display style to use, how percentages should be labeled, and whether session input/output tokens should appear in quota displays.
|
|
73
32
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
### After install
|
|
33
|
+
After install:
|
|
77
34
|
|
|
78
35
|
1. Restart OpenCode.
|
|
79
36
|
2. Run `/quota_status`.
|
|
80
37
|
3. Run `/quota`.
|
|
81
|
-
4. If you
|
|
38
|
+
4. If you enabled the sidebar, open the session sidebar and confirm the `Quota` panel appears.
|
|
82
39
|
|
|
83
|
-
|
|
40
|
+
For a terminal-only quota glance:
|
|
84
41
|
|
|
85
|
-
|
|
42
|
+
```bash
|
|
43
|
+
npx @slkiser/opencode-quota show
|
|
44
|
+
# or, if installed/on PATH:
|
|
45
|
+
opencode-quota show --provider copilot
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`show` is quota-only: no token/cost reports or `models.dev` refresh. Installer `None (commands and terminal only)` disables toast/sidebar but keeps `/quota`, `/tokens_*`, and terminal `show`.
|
|
49
|
+
|
|
50
|
+
### Manual setup
|
|
86
51
|
|
|
87
|
-
|
|
52
|
+
Add the server plugin to `opencode.json` or `opencode.jsonc`:
|
|
88
53
|
|
|
89
54
|
```jsonc
|
|
90
55
|
{
|
|
@@ -93,7 +58,7 @@ You can install manually, but the installer is easier and safer.
|
|
|
93
58
|
}
|
|
94
59
|
```
|
|
95
60
|
|
|
96
|
-
|
|
61
|
+
If you also want the sidebar, add the same package to the `tui.json` or `tui.jsonc` file that OpenCode loads:
|
|
97
62
|
|
|
98
63
|
```jsonc
|
|
99
64
|
{
|
|
@@ -102,61 +67,93 @@ You can install manually, but the installer is easier and safer.
|
|
|
102
67
|
}
|
|
103
68
|
```
|
|
104
69
|
|
|
105
|
-
|
|
70
|
+
All quota settings live in `opencode.json` or `opencode.jsonc`, not `tui.json`.
|
|
106
71
|
|
|
107
|
-
|
|
72
|
+
### What plugin adds
|
|
108
73
|
|
|
109
|
-
|
|
110
|
-
|
|
74
|
+
- TUI sidebar panel with quota rows
|
|
75
|
+
- Popup quota toasts after assistant responses
|
|
76
|
+
- Manual `/quota`, `/quota_status`, and `/tokens_*` commands
|
|
77
|
+
- Terminal `opencode-quota show` command for a quota-only quick glance
|
|
78
|
+
- Local token reports using bundled and runtime `models.dev` pricing
|
|
79
|
+
- Custom quota tracking for companion plugins
|
|
80
|
+
|
|
81
|
+
<table>
|
|
82
|
+
<tr>
|
|
83
|
+
<td width="50%">
|
|
84
|
+
<img src="https://shawnkiser.com/opencode-quota/toast.webp" alt="OpenCode Quota popup toast" />
|
|
85
|
+
</td>
|
|
86
|
+
<td width="50%">
|
|
87
|
+
<img src="https://shawnkiser.com/opencode-quota/token.webp" alt="OpenCode Quota token report" />
|
|
88
|
+
</td>
|
|
89
|
+
</tr>
|
|
90
|
+
<tr>
|
|
91
|
+
<td width="50%" align="center">Popup quota toast</td>
|
|
92
|
+
<td width="50%" align="center"><code>/tokens_weekly</code> report</td>
|
|
93
|
+
</tr>
|
|
94
|
+
</table>
|
|
111
95
|
|
|
112
|
-
|
|
96
|
+
### Providers
|
|
97
|
+
|
|
98
|
+
| Provider | Auto setup? | Setup / plugin order | Quota source |
|
|
99
|
+
| ----------------------- | ------------------ | --------------------------------------------------------- | ------------------------ |
|
|
100
|
+
| Anthropic (Claude) | [Needs quick setup](#anthropic-claude-quick-setup) | Install and authenticate Claude CLI | Local CLI or OAuth usage |
|
|
101
|
+
| GitHub Copilot | Usually automatic | Existing OpenCode auth, or optional PAT config | Remote API |
|
|
102
|
+
| OpenAI | Automatic | Existing OpenCode auth | Remote API |
|
|
103
|
+
| Cursor | [Needs quick setup](#cursor-quick-setup) | `["@playwo/opencode-cursor-oauth", "@slkiser/opencode-quota"]` | Local estimation |
|
|
104
|
+
| Qwen Code | [Needs quick setup](#qwen-code-quick-setup) | `["opencode-qwencode-auth", "@slkiser/opencode-quota"]` | Local estimation |
|
|
105
|
+
| Alibaba Coding Plan | Automatic | Existing OpenCode auth, global config, or env | Local estimation |
|
|
106
|
+
| MiniMax Coding Plan | Automatic | Existing OpenCode auth, global config, or env | Remote API |
|
|
107
|
+
| Kimi Code | Automatic | Existing OpenCode auth, global config, or env | Remote API |
|
|
108
|
+
| Chutes AI | Usually automatic | Existing OpenCode auth, global config, or env | Remote API |
|
|
109
|
+
| Synthetic | Automatic | Existing OpenCode auth, global config, or env | Remote API |
|
|
110
|
+
| Google Antigravity | [Needs quick setup](#google-antigravity-quick-setup) | `["opencode-antigravity-auth", "@slkiser/opencode-quota"]` | Remote API |
|
|
111
|
+
| Gemini CLI | [Needs quick setup](#gemini-cli-quick-setup) | `["opencode-gemini-auth", "@slkiser/opencode-quota"]` | Remote API |
|
|
112
|
+
| Z.ai Coding Plan | Automatic | Existing OpenCode auth, global config, or env | Remote API |
|
|
113
|
+
| NanoGPT | Usually automatic | Existing OpenCode auth, global config, or env | Remote API |
|
|
114
|
+
| OpenCode Go | [Needs quick setup](#opencode-go-quick-setup) | Set workspace ID and `auth` cookie | Dashboard scraping |
|
|
115
|
+
|
|
116
|
+
For companion auth providers, put the companion plugin first and `@slkiser/opencode-quota` second. The companion plugin handles login or token storage; OpenCode Quota reads that auth state and renders quota.
|
|
117
|
+
|
|
118
|
+
Providers are auto-detected by default. To choose providers explicitly:
|
|
113
119
|
|
|
114
120
|
```jsonc
|
|
115
121
|
{
|
|
116
|
-
"$schema": "https://opencode.ai/config.json",
|
|
117
|
-
"plugin": ["@slkiser/opencode-quota"],
|
|
118
122
|
"experimental": {
|
|
119
123
|
"quotaToast": {
|
|
120
|
-
"
|
|
124
|
+
"enabledProviders": ["copilot", "openai", "google-gemini-cli"],
|
|
121
125
|
},
|
|
122
126
|
},
|
|
123
127
|
}
|
|
124
128
|
```
|
|
125
129
|
|
|
126
|
-
|
|
130
|
+
### Display options
|
|
127
131
|
|
|
128
|
-
|
|
129
|
-
<summary><strong>Example: Turn off auto-detection and choose providers</strong></summary>
|
|
132
|
+
Show every quota window instead of the default most-constrained window:
|
|
130
133
|
|
|
131
134
|
```jsonc
|
|
132
135
|
{
|
|
133
136
|
"experimental": {
|
|
134
137
|
"quotaToast": {
|
|
135
|
-
"
|
|
138
|
+
"formatStyle": "allWindows",
|
|
136
139
|
},
|
|
137
140
|
},
|
|
138
141
|
}
|
|
139
142
|
```
|
|
140
143
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
<details>
|
|
144
|
-
<summary><strong>Example: Show all quota windows instead of the default single-window layout</strong></summary>
|
|
144
|
+
Choose which OpenCode Go usage windows to display (default is all three; `rolling` displays as `5h`):
|
|
145
145
|
|
|
146
146
|
```jsonc
|
|
147
147
|
{
|
|
148
148
|
"experimental": {
|
|
149
149
|
"quotaToast": {
|
|
150
|
-
"
|
|
150
|
+
"opencodeGoWindows": ["rolling", "weekly", "monthly"],
|
|
151
151
|
},
|
|
152
152
|
},
|
|
153
153
|
}
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
<details>
|
|
159
|
-
<summary><strong>Example: Show percent used instead of percent remaining in toasts and the sidebar</strong></summary>
|
|
156
|
+
Show percentages as used instead of remaining in toasts and the sidebar:
|
|
160
157
|
|
|
161
158
|
```jsonc
|
|
162
159
|
{
|
|
@@ -168,57 +165,59 @@ Keep the `tui.json` or `tui.jsonc` entry above and disable toasts in `opencode.j
|
|
|
168
165
|
}
|
|
169
166
|
```
|
|
170
167
|
|
|
171
|
-
|
|
168
|
+
Turn off popup toasts while keeping `/quota` and the sidebar:
|
|
172
169
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
| **Alibaba Coding Plan** | Yes | OpenCode auth/global config/env | Local estimation |
|
|
183
|
-
| **Synthetic** | Yes | OpenCode auth/global config/env | Remote API |
|
|
184
|
-
| **Chutes AI** | Usually | OpenCode auth/global config/env | Remote API |
|
|
185
|
-
| **Google Antigravity** | Needs [quick setup](#google-antigravity-quick-setup) | Companion auth | Remote API |
|
|
186
|
-
| **Z.ai** | Yes | OpenCode auth/global config/env | Remote API |
|
|
187
|
-
| **NanoGPT** | Usually | OpenCode auth/global config/env | Remote API |
|
|
188
|
-
| **MiniMax Coding Plan** | Yes | OpenCode auth/global config/env | Remote API |
|
|
189
|
-
| **Kimi Code** | Yes | OpenCode auth/global config/env | Remote API |
|
|
190
|
-
| **OpenCode Go** | Needs [quick setup](#opencode-go-quick-setup) | Env/config auth | Dashboard scraping |
|
|
191
|
-
|
|
192
|
-
<a id="anthropic-quick-setup"></a>
|
|
170
|
+
```jsonc
|
|
171
|
+
{
|
|
172
|
+
"experimental": {
|
|
173
|
+
"quotaToast": {
|
|
174
|
+
"enableToast": false,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
}
|
|
178
|
+
```
|
|
193
179
|
|
|
194
|
-
|
|
195
|
-
<summary><strong>Quick setup: Anthropic (Claude)</strong></summary>
|
|
180
|
+
### Commands
|
|
196
181
|
|
|
197
|
-
|
|
182
|
+
| Command | What it shows |
|
|
183
|
+
| --------------------- | -------------------------------------------------- |
|
|
184
|
+
| `opencode-quota show` | Terminal quota-only quick glance |
|
|
185
|
+
| `/quota` | Detailed quota report |
|
|
186
|
+
| `/quota_status` | Config, provider, auth, pricing, and live probes |
|
|
187
|
+
| `/pricing_refresh` | Refresh local runtime pricing from `models.dev` |
|
|
188
|
+
| `/tokens_today` | Tokens used today |
|
|
189
|
+
| `/tokens_daily` | Tokens used in the last 24 hours |
|
|
190
|
+
| `/tokens_weekly` | Tokens used in the last 7 days |
|
|
191
|
+
| `/tokens_monthly` | Tokens used in the last 30 days, including pricing |
|
|
192
|
+
| `/tokens_all` | Tokens used across all local history |
|
|
193
|
+
| `/tokens_session` | Tokens used in the current session |
|
|
194
|
+
| `/tokens_session_all` | Current session plus descendant sessions |
|
|
195
|
+
| `/tokens_between` | Tokens used between `YYYY-MM-DD YYYY-MM-DD` |
|
|
198
196
|
|
|
199
|
-
|
|
197
|
+
<a id="anthropic-claude-quick-setup"></a>
|
|
200
198
|
|
|
201
|
-
|
|
202
|
-
2. Run `claude auth login`.
|
|
203
|
-
3. Confirm `claude auth status --json` or `claude auth status` succeeds locally.
|
|
204
|
-
4. Confirm OpenCode is configured with the `anthropic` provider.
|
|
199
|
+
### Anthropic quick setup
|
|
205
200
|
|
|
206
|
-
|
|
201
|
+
Anthropic does not use a companion OpenCode plugin. Install Claude Code, authenticate it, and make sure `claude` is available on your `PATH`:
|
|
207
202
|
|
|
208
|
-
|
|
203
|
+
```bash
|
|
204
|
+
claude auth login
|
|
205
|
+
claude auth status
|
|
206
|
+
```
|
|
209
207
|
|
|
210
|
-
If
|
|
208
|
+
If Claude lives at a custom path, set `experimental.quotaToast.anthropicBinaryPath` in `opencode.json`.
|
|
211
209
|
|
|
212
|
-
|
|
210
|
+
### Companion providers
|
|
213
211
|
|
|
214
|
-
|
|
212
|
+
Some providers need an auth companion plugin installed separately. Add the companion plugin first and `@slkiser/opencode-quota` second in `opencode.json` or `opencode.jsonc`.
|
|
215
213
|
|
|
216
214
|
<a id="cursor-quick-setup"></a>
|
|
217
215
|
|
|
218
|
-
|
|
219
|
-
<summary><strong>Quick setup: Cursor</strong></summary>
|
|
216
|
+
#### Cursor
|
|
220
217
|
|
|
221
|
-
|
|
218
|
+
Companion plugin: [`@playwo/opencode-cursor-oauth`](https://github.com/PoolPirate/opencode-cursor#readme)
|
|
219
|
+
|
|
220
|
+
Add both plugins to `opencode.json`, with the Cursor auth plugin first:
|
|
222
221
|
|
|
223
222
|
```jsonc
|
|
224
223
|
{
|
|
@@ -226,547 +225,269 @@ Cursor quota support requires the `@playwo/opencode-cursor-oauth` [plugin](https
|
|
|
226
225
|
"plugin": ["@playwo/opencode-cursor-oauth", "@slkiser/opencode-quota"],
|
|
227
226
|
"provider": {
|
|
228
227
|
"cursor": {
|
|
229
|
-
"name": "Cursor"
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
"experimental": {
|
|
233
|
-
"quotaToast": {
|
|
234
|
-
"cursorPlan": "pro",
|
|
235
|
-
"cursorBillingCycleStartDay": 7,
|
|
236
|
-
},
|
|
237
|
-
},
|
|
228
|
+
"name": "Cursor"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
238
231
|
}
|
|
239
232
|
```
|
|
240
233
|
|
|
241
|
-
Then authenticate once:
|
|
234
|
+
Then authenticate Cursor once:
|
|
242
235
|
|
|
243
|
-
```
|
|
236
|
+
```bash
|
|
244
237
|
opencode auth login --provider cursor
|
|
245
238
|
```
|
|
246
239
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
</details>
|
|
240
|
+
<a id="qwen-code-quick-setup"></a>
|
|
250
241
|
|
|
251
|
-
|
|
242
|
+
#### Qwen Code
|
|
252
243
|
|
|
253
|
-
|
|
254
|
-
<summary><strong>Quick setup: Google Antigravity</strong></summary>
|
|
244
|
+
Companion plugin: [`opencode-qwencode-auth`](https://github.com/gustavodiasdev/opencode-qwencode-auth#readme)
|
|
255
245
|
|
|
256
|
-
|
|
246
|
+
Add both plugins to `opencode.json`, with the Qwen auth plugin first:
|
|
257
247
|
|
|
258
248
|
```jsonc
|
|
259
249
|
{
|
|
260
|
-
"
|
|
250
|
+
"$schema": "https://opencode.ai/config.json",
|
|
251
|
+
"plugin": ["opencode-qwencode-auth", "@slkiser/opencode-quota"]
|
|
261
252
|
}
|
|
262
253
|
```
|
|
263
254
|
|
|
264
|
-
|
|
255
|
+
<a id="google-antigravity-quick-setup"></a>
|
|
265
256
|
|
|
266
|
-
|
|
257
|
+
#### Google Antigravity
|
|
267
258
|
|
|
268
|
-
|
|
259
|
+
Companion plugin: [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth#readme)
|
|
269
260
|
|
|
270
|
-
|
|
271
|
-
<summary><strong>Quick setup: Qwen Code</strong></summary>
|
|
272
|
-
|
|
273
|
-
Qwen quota support requires the `opencode-qwencode-auth` [plugin](https://github.com/gustavodiasdev/opencode-qwencode-auth):
|
|
261
|
+
Add both plugins to `opencode.json`, with the Antigravity auth plugin first:
|
|
274
262
|
|
|
275
263
|
```jsonc
|
|
276
264
|
{
|
|
277
|
-
"
|
|
265
|
+
"$schema": "https://opencode.ai/config.json",
|
|
266
|
+
"plugin": ["opencode-antigravity-auth", "@slkiser/opencode-quota"]
|
|
278
267
|
}
|
|
279
268
|
```
|
|
280
269
|
|
|
281
|
-
|
|
270
|
+
<a id="gemini-cli-quick-setup"></a>
|
|
282
271
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
<a id="opencode-go-quick-setup"></a>
|
|
286
|
-
|
|
287
|
-
<details>
|
|
288
|
-
<summary><strong>Quick setup: OpenCode Go</strong></summary>
|
|
289
|
-
|
|
290
|
-
OpenCode Go quota scrapes the OpenCode Go dashboard. It requires a workspace ID and an auth cookie.
|
|
272
|
+
#### Gemini CLI
|
|
291
273
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
```sh
|
|
295
|
-
export OPENCODE_GO_WORKSPACE_ID="your-workspace-id"
|
|
296
|
-
export OPENCODE_GO_AUTH_COOKIE="your-auth-cookie"
|
|
297
|
-
```
|
|
274
|
+
Companion plugin: [`opencode-gemini-auth`](https://github.com/jenslys/opencode-gemini-auth#readme)
|
|
298
275
|
|
|
299
|
-
|
|
276
|
+
Add both plugins to `opencode.json`, with the Gemini auth plugin first. If you manually choose providers, include `google-gemini-cli`:
|
|
300
277
|
|
|
301
|
-
```
|
|
278
|
+
```jsonc
|
|
302
279
|
{
|
|
303
|
-
"
|
|
304
|
-
"
|
|
280
|
+
"$schema": "https://opencode.ai/config.json",
|
|
281
|
+
"plugin": ["opencode-gemini-auth", "@slkiser/opencode-quota"],
|
|
282
|
+
"experimental": {
|
|
283
|
+
"quotaToast": {
|
|
284
|
+
"enabledProviders": ["google-gemini-cli"]
|
|
285
|
+
}
|
|
286
|
+
}
|
|
305
287
|
}
|
|
306
288
|
```
|
|
307
289
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
1. **workspaceId** — Visit [opencode.ai](https://opencode.ai), open your workspace, and copy the workspace ID from the URL: `https://opencode.ai/workspace/<workspaceId>/go`.
|
|
311
|
-
2. **authCookie** — Open your browser DevTools on `opencode.ai`, go to Application → Cookies, and copy the value of the `auth` cookie.
|
|
312
|
-
|
|
313
|
-
Environment variables take precedence over the config file. Run `/quota_status` to see the exact config paths checked on your machine. For behavior details and troubleshooting, see [OpenCode Go notes](#opencode-go-notes).
|
|
314
|
-
|
|
315
|
-
</details>
|
|
316
|
-
|
|
317
|
-
## Commands
|
|
318
|
-
|
|
319
|
-
| Command | What it shows |
|
|
320
|
-
| --------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
321
|
-
| `/quota` | Manual detailed all-window quota report with a local call timestamp |
|
|
322
|
-
| `/quota_status` | Concise diagnostics for config, TUI setup, provider availability, account detection, pricing snapshot health, and fresh compact single-window live probe rows in matching provider sections |
|
|
323
|
-
| `/pricing_refresh` | Pull the local runtime pricing snapshot from `models.dev` on demand |
|
|
324
|
-
| `/tokens_today` | Tokens used today (calendar day) |
|
|
325
|
-
| `/tokens_daily` | Tokens used in the last 24 hours |
|
|
326
|
-
| `/tokens_weekly` | Tokens used in the last 7 days |
|
|
327
|
-
| `/tokens_monthly` | Tokens used in the last 30 days, including pricing sections |
|
|
328
|
-
| `/tokens_all` | Tokens used across all local history |
|
|
329
|
-
| `/tokens_session` | Tokens used in the current session only |
|
|
330
|
-
| `/tokens_session_all` | Tokens used in the current session plus all descendant child/subagent sessions |
|
|
331
|
-
| `/tokens_between` | Tokens used between two dates: `YYYY-MM-DD YYYY-MM-DD` |
|
|
332
|
-
|
|
333
|
-
## Provider-Specific Notes
|
|
334
|
-
|
|
335
|
-
`/quota_status` keeps each provider's existing diagnostics and, for enabled + available supported providers, also appends a fresh sanitized compact probe summary (`live_probe`, `live_entry_*`, `live_error_*`) in that provider's section. If a fresh probe returns nothing reportable, `/quota_status` shows `live_probe: no_data`. Qwen Code and Alibaba Coding Plan use dedicated `qwen_code` and `alibaba_coding_plan` compact probe sections because their auth and local-state diagnostics already live under `paths` and `cursor`.
|
|
336
|
-
|
|
337
|
-
<a id="anthropic-notes"></a>
|
|
338
|
-
|
|
339
|
-
<details>
|
|
340
|
-
<summary><strong>Anthropic (Claude)</strong></summary>
|
|
341
|
-
|
|
342
|
-
The plugin probes the local Claude CLI with `anthropicBinaryPath --version` and `anthropicBinaryPath auth status --json` first. By default `anthropicBinaryPath` is `claude`, so standard installs work without extra config.
|
|
343
|
-
|
|
344
|
-
If the Claude CLI exposes 5-hour and 7-day quota windows in local structured output, the plugin shows them directly. If the CLI only exposes auth state, the plugin falls back to the macOS Keychain service `Claude Code-credentials` and then `~/.claude/.credentials.json` before calling Anthropic's OAuth usage endpoint. When Claude is authenticated but both quota probes fail, `/quota`, toasts, and the sidebar surface a sanitized Anthropic error instead of silently skipping the provider.
|
|
345
|
-
|
|
346
|
-
- Provider availability remains local-only: Anthropic is considered available when the local Claude CLI is installed and authenticated.
|
|
347
|
-
- `experimental.quotaToast.anthropicBinaryPath` only changes CLI probing. It does not change Claude OAuth credential lookup locations.
|
|
348
|
-
- `/quota_status` shows `quota_source` as either `claude-auth-status-json`, `claude-credentials-oauth-api`, or `(none)`.
|
|
349
|
-
|
|
350
|
-
**Troubleshooting:**
|
|
351
|
-
|
|
352
|
-
| Problem | Solution |
|
|
353
|
-
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
354
|
-
| `claude` not found | Install Claude Code and make sure `claude` is on your `PATH` |
|
|
355
|
-
| Claude installed at a custom path | Set `experimental.quotaToast.anthropicBinaryPath` to the Claude executable path |
|
|
356
|
-
| Not authenticated | Run `claude auth login`, then confirm `claude auth status --json` or `claude auth status` works |
|
|
357
|
-
| Authenticated but no quota rows | Run `/quota_status` and check `quota_source` plus `message` to see whether the local CLI, the macOS Keychain / fallback credentials file, or the fallback API failed |
|
|
358
|
-
| Missing or invalid Claude OAuth credentials | Re-authenticate Claude Code so it refreshes the macOS Keychain entry and local credentials file, then rerun `/quota_status` |
|
|
359
|
-
| Fallback API error or no quota response | Check `/quota_status` for the sanitized fallback error detail and retry after Claude Code refreshes local auth |
|
|
360
|
-
| Plugin not detected | Confirm OpenCode is configured with the `anthropic` provider |
|
|
290
|
+
Then authenticate Google once:
|
|
361
291
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
<a id="github-copilot-notes"></a>
|
|
365
|
-
|
|
366
|
-
<details>
|
|
367
|
-
<summary><strong>GitHub Copilot</strong></summary>
|
|
368
|
-
|
|
369
|
-
Personal quota works automatically when OpenCode is already signed in. Without `copilot-quota-token.json`, the plugin reads the OpenCode Copilot OAuth token from `~/.local/share/opencode/auth.json` and calls `GET https://api.github.com/copilot_internal/user`.
|
|
370
|
-
|
|
371
|
-
- Managed billing uses `copilot-quota-token.json` in the OpenCode runtime config directory (`opencode debug paths`). `business` requires `organization`; `enterprise` requires `enterprise` and can also filter by `organization` or `username`.
|
|
372
|
-
- `copilot-quota-token.json` takes precedence over OAuth. If the PAT config is invalid, the plugin reports that error and does not silently fall back.
|
|
373
|
-
- Output is labeled `[Copilot] (personal)` or `[Copilot] (business)`, and managed output includes the org or enterprise slug.
|
|
374
|
-
- Enterprise premium usage does not support fine-grained PATs or GitHub App tokens.
|
|
375
|
-
- Check `/quota_status` for `copilot_quota_auth`, `billing_mode`, `billing_scope`, `quota_api`, `effective_source`, and `billing_api_access_likely`.
|
|
376
|
-
|
|
377
|
-
Example `copilot-quota-token.json`:
|
|
378
|
-
|
|
379
|
-
```json
|
|
380
|
-
{
|
|
381
|
-
"token": "github_pat_...",
|
|
382
|
-
"tier": "business",
|
|
383
|
-
"organization": "your-org-slug"
|
|
384
|
-
}
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
```json
|
|
388
|
-
{
|
|
389
|
-
"token": "ghp_...",
|
|
390
|
-
"tier": "enterprise",
|
|
391
|
-
"enterprise": "your-enterprise-slug",
|
|
392
|
-
"organization": "optional-org-filter",
|
|
393
|
-
"username": "optional-user-filter"
|
|
394
|
-
}
|
|
292
|
+
```bash
|
|
293
|
+
opencode auth login --provider google
|
|
395
294
|
```
|
|
396
295
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
<a id="cursor-notes"></a>
|
|
400
|
-
|
|
401
|
-
<details>
|
|
402
|
-
<summary><strong>Cursor</strong></summary>
|
|
403
|
-
|
|
404
|
-
See [Cursor quick setup](#cursor-quick-setup) for companion-plugin OAuth auth. The canonical companion package is `@playwo/opencode-cursor-oauth`; older plugin names such as `opencode-cursor-oauth`, `opencode-cursor`, and `cursor-acp` are still detected as compatibility aliases. Quota and token reporting stays local to OpenCode history and local pricing data.
|
|
296
|
+
### OpenCode Go
|
|
405
297
|
|
|
406
|
-
|
|
407
|
-
- `/tokens_*` maps Cursor API-pool models to official pricing and uses bundled static pricing for `auto` and `composer*`.
|
|
408
|
-
- `/quota` and toasts estimate the current billing-cycle spend from local history only. Session cookies and team APIs are not required.
|
|
409
|
-
- Remaining percentage appears only when `experimental.quotaToast.cursorPlan` or `experimental.quotaToast.cursorIncludedApiUsd` is set. Billing cycle defaults to the local calendar month unless `experimental.quotaToast.cursorBillingCycleStartDay` is set.
|
|
410
|
-
- Legacy `cursor-acp/*` history remains readable. Unknown future Cursor model ids appear in `/quota_status` under Cursor diagnostics and `unknown_pricing`.
|
|
298
|
+
<a id="opencode-go-quick-setup"></a>
|
|
411
299
|
|
|
412
|
-
|
|
300
|
+
OpenCode Go quota scrapes the dashboard and needs a workspace ID plus an `auth` cookie:
|
|
413
301
|
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
"quotaToast": {
|
|
418
|
-
"cursorPlan": "none",
|
|
419
|
-
"cursorIncludedApiUsd": 120,
|
|
420
|
-
},
|
|
421
|
-
},
|
|
422
|
-
}
|
|
302
|
+
```bash
|
|
303
|
+
export OPENCODE_GO_WORKSPACE_ID="your-workspace-id"
|
|
304
|
+
export OPENCODE_GO_AUTH_COOKIE="your-auth-cookie"
|
|
423
305
|
```
|
|
424
306
|
|
|
425
|
-
|
|
307
|
+
The provider can report three usage windows — **5h** rolling, **Weekly**, and **Monthly** — and emits whichever dashboard windows are available in that order. Filter displayed windows with `experimental.quotaToast.opencodeGoWindows` (`rolling`, `weekly`, `monthly`); non-default subsets report missing selected dashboard fields, while default/all-windows mode shows available windows and diagnostics indicate what was found.
|
|
426
308
|
|
|
427
|
-
|
|
309
|
+
Environment variables take precedence over the optional `opencode-go.json` config file. Run `/quota_status` to see the exact paths checked on your machine.
|
|
428
310
|
|
|
429
|
-
|
|
430
|
-
<summary><strong>OpenAI</strong></summary>
|
|
311
|
+
### Troubleshooting
|
|
431
312
|
|
|
432
|
-
|
|
313
|
+
If quota or token data looks wrong:
|
|
433
314
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
315
|
+
1. Run `/quota_status`.
|
|
316
|
+
2. Confirm the expected provider appears in the detected provider list.
|
|
317
|
+
3. Confirm OpenCode has already created `opencode.db` if token reports are empty.
|
|
318
|
+
4. Check companion plugins for Cursor, Qwen Code, Google Antigravity, and Gemini CLI.
|
|
319
|
+
5. Use the quick-setup link in the provider table for provider-specific auth and config notes.
|
|
439
320
|
|
|
440
|
-
|
|
321
|
+
### Provider Troubleshooting
|
|
441
322
|
|
|
442
323
|
<details>
|
|
443
|
-
<summary><strong>
|
|
324
|
+
<summary><strong>Anthropic (Claude)</strong></summary>
|
|
444
325
|
|
|
445
|
-
|
|
326
|
+
Run `/quota_status` and check the Anthropic section.
|
|
446
327
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
328
|
+
| Symptom | Fix |
|
|
329
|
+
| --- | --- |
|
|
330
|
+
| `claude` not found | Install Claude Code and make sure `claude` is on your `PATH`. |
|
|
331
|
+
| Claude is installed at a custom path | Set `experimental.quotaToast.anthropicBinaryPath` in `opencode.json`. |
|
|
332
|
+
| Not authenticated | Run `claude auth login`, then confirm `claude auth status` works. |
|
|
333
|
+
| Auth works but no quota rows appear | Check `quota_source` and `message` in `/quota_status`; re-authenticate Claude if the OAuth credential fallback is missing or stale. |
|
|
334
|
+
| Provider not detected | Confirm OpenCode is configured to use the `anthropic` provider. |
|
|
452
335
|
|
|
453
336
|
</details>
|
|
454
337
|
|
|
455
|
-
<a id="alibaba-coding-plan-notes"></a>
|
|
456
|
-
|
|
457
338
|
<details>
|
|
458
|
-
<summary><strong>
|
|
459
|
-
|
|
460
|
-
Alibaba Coding Plan uses trusted env vars or trusted user/global OpenCode config first, then native OpenCode auth from `alibaba-coding-plan` or `alibaba` in `auth.json`. Quota is local request-count estimation with rolling windows.
|
|
339
|
+
<summary><strong>GitHub Copilot</strong></summary>
|
|
461
340
|
|
|
462
|
-
|
|
463
|
-
- `pro`: `6000 / 5h`, `45000 / week`, `90000 / month`
|
|
464
|
-
- API key sources are `ALIBABA_CODING_PLAN_API_KEY`, `ALIBABA_API_KEY`, trusted user/global `provider["alibaba-coding-plan"].options.apiKey` or `provider.alibaba.options.apiKey`, then `auth.json`.
|
|
465
|
-
- Repo-local `opencode.json` / `opencode.jsonc` is ignored for Alibaba secrets.
|
|
466
|
-
- Allowed env templates are limited to `{env:ALIBABA_CODING_PLAN_API_KEY}` and `{env:ALIBABA_API_KEY}`.
|
|
467
|
-
- If auth fallback wins and omits `tier`, or if env/config wins, the plugin uses `experimental.quotaToast.alibabaCodingPlanTier`, which defaults to `lite`.
|
|
468
|
-
- Counters increment on successful question-tool completions while the current model is `alibaba/*` or `alibaba-cn/*`.
|
|
469
|
-
- State file: `.../opencode/opencode-quota/alibaba-coding-plan-local-quota.json`.
|
|
470
|
-
- `/quota_status` shows auth detection, resolved tier, state-file path, current 5h/weekly/monthly usage, and the dedicated `alibaba_coding_plan` compact live probe section when Alibaba Coding Plan is enabled and available.
|
|
341
|
+
Run `/quota_status` and check `copilot_quota_auth`, `billing_mode`, `billing_scope`, and `quota_api`.
|
|
471
342
|
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
"alibabaCodingPlanTier": "lite",
|
|
479
|
-
},
|
|
480
|
-
},
|
|
481
|
-
}
|
|
482
|
-
```
|
|
343
|
+
| Symptom | Fix |
|
|
344
|
+
| --- | --- |
|
|
345
|
+
| Personal quota missing | Confirm OpenCode Copilot auth works. The plugin can read OpenCode's Copilot OAuth token. |
|
|
346
|
+
| Business or Enterprise quota missing | Add `copilot-quota-token.json` in the OpenCode runtime config directory shown by `opencode debug paths`. |
|
|
347
|
+
| PAT config exists but quota fails | Fix `copilot-quota-token.json`; when present, it takes precedence over OAuth and does not silently fall back. |
|
|
348
|
+
| Enterprise usage missing | Use a classic PAT with the required billing access. Fine-grained PATs and GitHub App tokens are not supported for Enterprise premium usage. |
|
|
483
349
|
|
|
484
350
|
</details>
|
|
485
351
|
|
|
486
|
-
<a id="minimax-coding-plan-notes"></a>
|
|
487
|
-
|
|
488
352
|
<details>
|
|
489
|
-
<summary><strong>
|
|
353
|
+
<summary><strong>OpenAI</strong></summary>
|
|
490
354
|
|
|
491
|
-
|
|
355
|
+
Run `/quota_status` and check the OpenAI auth source and token status.
|
|
492
356
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
- `/quota_status` shows auth detection, API-key diagnostics, live quota state, and endpoint errors
|
|
357
|
+
| Symptom | Fix |
|
|
358
|
+
| --- | --- |
|
|
359
|
+
| OpenAI quota missing | Confirm OpenCode native OpenAI auth is present in `auth.json`. |
|
|
360
|
+
| Token expired | Re-run OpenCode's OpenAI auth flow. |
|
|
361
|
+
| Provider not detected | Confirm your OpenCode config uses the `openai` provider or a compatible OpenAI auth entry. |
|
|
499
362
|
|
|
500
363
|
</details>
|
|
501
364
|
|
|
502
|
-
<a id="kimi-code-notes"></a>
|
|
503
|
-
|
|
504
365
|
<details>
|
|
505
|
-
<summary><strong>
|
|
366
|
+
<summary><strong>Cursor</strong></summary>
|
|
506
367
|
|
|
507
|
-
|
|
368
|
+
Run `/quota_status` and check the Cursor section.
|
|
508
369
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
370
|
+
| Symptom | Fix |
|
|
371
|
+
| --- | --- |
|
|
372
|
+
| Cursor not detected | Put `@playwo/opencode-cursor-oauth` before `@slkiser/opencode-quota` in `opencode.json`. |
|
|
373
|
+
| Cursor auth missing | Run `opencode auth login --provider cursor`. |
|
|
374
|
+
| Quota appears but no remaining percentage | Set `experimental.quotaToast.cursorPlan` or `experimental.quotaToast.cursorIncludedApiUsd`. |
|
|
375
|
+
| Billing cycle looks wrong | Set `experimental.quotaToast.cursorBillingCycleStartDay` to your local billing anchor day. |
|
|
376
|
+
| Unknown Cursor pricing | Run `/pricing_refresh`; if still unknown, check `/quota_status` for unknown model ids. |
|
|
514
377
|
|
|
515
378
|
</details>
|
|
516
379
|
|
|
517
|
-
<a id="zai-notes"></a>
|
|
518
|
-
|
|
519
380
|
<details>
|
|
520
|
-
<summary><strong>
|
|
381
|
+
<summary><strong>Qwen Code</strong></summary>
|
|
521
382
|
|
|
522
|
-
|
|
383
|
+
Run `/quota_status` and check `qwen_oauth_source`, `qwen_local_plan`, and the `qwen_code` live probe section.
|
|
523
384
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
385
|
+
| Symptom | Fix |
|
|
386
|
+
| --- | --- |
|
|
387
|
+
| Qwen not detected | Put `opencode-qwencode-auth` before `@slkiser/opencode-quota` in `opencode.json`. |
|
|
388
|
+
| Auth missing | Complete the Qwen companion plugin auth flow. |
|
|
389
|
+
| Counters do not move | Confirm the current model is `qwen-code/*`; Qwen quota is local request estimation for matching model usage. |
|
|
390
|
+
| Usage looks stale | Check the local state file path shown by `/quota_status`. |
|
|
529
391
|
|
|
530
392
|
</details>
|
|
531
393
|
|
|
532
|
-
<a id="synthetic-notes"></a>
|
|
533
|
-
|
|
534
394
|
<details>
|
|
535
|
-
<summary><strong>
|
|
536
|
-
|
|
537
|
-
If OpenCode already has Synthetic configured, it should work automatically. Optional API key: `provider.synthetic.options.apiKey`.
|
|
538
|
-
|
|
539
|
-
For security, provider secrets are read from `SYNTHETIC_API_KEY`, your user/global OpenCode config, or `auth.json.synthetic` only. Repo-local `opencode.json` / `opencode.jsonc` is ignored for `provider.synthetic.options.apiKey`.
|
|
540
|
-
|
|
541
|
-
- The plugin calls `GET https://api.synthetic.new/v2/quotas`.
|
|
542
|
-
- It uses only the current top-level Synthetic payload sections: `rollingFiveHourLimit` (`max`, `remaining`, `nextTickAt`) and `weeklyTokenLimit` (`maxCredits`, `remainingCredits`, `percentRemaining`, `nextRegenAt`).
|
|
543
|
-
- `weeklyTokenLimit.maxCredits` and `weeklyTokenLimit.remainingCredits` are parsed from the real Synthetic dollar-string format (for example `$24.00` and `$2.02`). Legacy `subscription.limit`, `subscription.requests`, and `subscription.renewsAt` are ignored.
|
|
544
|
-
- Missing or malformed top-level windows are treated as API-shape errors. Invalid reset timestamps are ignored. Weekly `percentRemaining` uses `weeklyTokenLimit.percentRemaining` when valid and otherwise falls back to deterministic derivation from the parsed credit amounts.
|
|
545
|
-
- `/quota` always shows both Synthetic windows (`5h:` and `Weekly:` rows under `Synthetic`). Toast/sidebar in `singleWindow` mode collapse to the most constrained Synthetic row; `allWindows` mode shows both rows.
|
|
546
|
-
- Compact summaries still round displayed `used` values, and the weekly row keeps dollar semantics (for example `$22/$24`) instead of showing long floats.
|
|
547
|
-
- `/quota_status` keeps the existing Synthetic API-key diagnostics and adds a compact sanitized live probe summary from those same Synthetic rows when Synthetic is enabled and detected/available.
|
|
548
|
-
- Allowed env templates are limited to `{env:SYNTHETIC_API_KEY}`.
|
|
395
|
+
<summary><strong>Alibaba Coding Plan</strong></summary>
|
|
549
396
|
|
|
550
|
-
|
|
397
|
+
Run `/quota_status` and check the Alibaba auth, resolved tier, state-file path, and `alibaba_coding_plan` live probe section.
|
|
551
398
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
},
|
|
559
|
-
},
|
|
560
|
-
},
|
|
561
|
-
}
|
|
562
|
-
```
|
|
399
|
+
| Symptom | Fix |
|
|
400
|
+
| --- | --- |
|
|
401
|
+
| API key not detected | Use `ALIBABA_CODING_PLAN_API_KEY`, `ALIBABA_API_KEY`, trusted user/global OpenCode config, or OpenCode auth. Repo-local provider secrets are ignored. |
|
|
402
|
+
| Wrong tier | Set `experimental.quotaToast.alibabaCodingPlanTier` to `lite` or `pro`. |
|
|
403
|
+
| Counters do not move | Confirm the current model is `alibaba/*` or `alibaba-cn/*`. |
|
|
404
|
+
| Quota seems stale | Check the state-file path shown in `/quota_status`. |
|
|
563
405
|
|
|
564
406
|
</details>
|
|
565
407
|
|
|
566
|
-
<a id="chutes-ai-notes"></a>
|
|
567
|
-
|
|
568
408
|
<details>
|
|
569
|
-
<summary><strong>Chutes AI</strong></summary>
|
|
570
|
-
|
|
571
|
-
If OpenCode already has Chutes configured, it usually works automatically. Optional API key: `provider.chutes.options.apiKey`.
|
|
409
|
+
<summary><strong>MiniMax, Kimi, Chutes AI, Synthetic, Z.ai, and NanoGPT</strong></summary>
|
|
572
410
|
|
|
573
|
-
|
|
411
|
+
These providers use trusted env vars, trusted user/global OpenCode config, or native OpenCode auth. Run `/quota_status` and check the provider-specific API-key diagnostics.
|
|
574
412
|
|
|
575
|
-
|
|
413
|
+
| Provider | Useful checks |
|
|
414
|
+
| --- | --- |
|
|
415
|
+
| MiniMax Coding Plan | Use `MINIMAX_CODING_PLAN_API_KEY` or `MINIMAX_API_KEY`; repo-local provider secrets are ignored. |
|
|
416
|
+
| Kimi Code | Use `KIMI_API_KEY` or `KIMI_CODE_API_KEY`; repo-local provider secrets are ignored. |
|
|
417
|
+
| Chutes AI | Use `CHUTES_API_KEY` or trusted user/global config. |
|
|
418
|
+
| Synthetic | Use `SYNTHETIC_API_KEY`, trusted user/global config, or OpenCode auth. |
|
|
419
|
+
| Z.ai Coding Plan | Use `ZAI_API_KEY` or `ZAI_CODING_PLAN_API_KEY`; malformed fallback auth is surfaced as an auth error. |
|
|
420
|
+
| NanoGPT | Use `NANOGPT_API_KEY`, `NANO_GPT_API_KEY`, trusted user/global config, or OpenCode auth. |
|
|
576
421
|
|
|
577
|
-
-
|
|
578
|
-
|
|
579
|
-
Example user/global config (`~/.config/opencode/opencode.jsonc` on Linux/macOS):
|
|
580
|
-
|
|
581
|
-
```jsonc
|
|
582
|
-
{
|
|
583
|
-
"provider": {
|
|
584
|
-
"chutes": {
|
|
585
|
-
"options": {
|
|
586
|
-
"apiKey": "{env:CHUTES_API_KEY}",
|
|
587
|
-
},
|
|
588
|
-
},
|
|
589
|
-
},
|
|
590
|
-
}
|
|
591
|
-
```
|
|
422
|
+
For security, repo-local `opencode.json` / `opencode.jsonc` is ignored for provider secrets in these integrations. Put secrets in environment variables or trusted user/global config.
|
|
592
423
|
|
|
593
424
|
</details>
|
|
594
425
|
|
|
595
|
-
<a id="google-antigravity-notes"></a>
|
|
596
|
-
|
|
597
426
|
<details>
|
|
598
427
|
<summary><strong>Google Antigravity</strong></summary>
|
|
599
428
|
|
|
600
|
-
|
|
429
|
+
Run `/quota_status` and check the `google_antigravity` section.
|
|
601
430
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
431
|
+
| Symptom | Fix |
|
|
432
|
+
| --- | --- |
|
|
433
|
+
| Companion missing | Put `opencode-antigravity-auth` before `@slkiser/opencode-quota` in `opencode.json`. |
|
|
434
|
+
| Accounts not found | Check the selected `antigravity-accounts.json` path shown by `/quota_status`. |
|
|
435
|
+
| Refresh tokens invalid | Re-authenticate with the companion plugin. |
|
|
436
|
+
| Provider returns no rows | Check `live_probe`, `live_entry_*`, and `live_error_*` in `/quota_status`. |
|
|
605
437
|
|
|
606
438
|
</details>
|
|
607
439
|
|
|
608
|
-
<a id="nanogpt-notes"></a>
|
|
609
|
-
|
|
610
440
|
<details>
|
|
611
|
-
<summary><strong>
|
|
612
|
-
|
|
613
|
-
NanoGPT uses live NanoGPT subscription usage and balance endpoints, so `/quota`, both quota display styles (`singleWindow` and `allWindows`), and `/quota_status` can show daily quota, monthly quota, and account balance in real time.
|
|
441
|
+
<summary><strong>Gemini CLI</strong></summary>
|
|
614
442
|
|
|
615
|
-
|
|
616
|
-
- Optional API key: `provider.nanogpt.options.apiKey` or `provider["nano-gpt"].options.apiKey`.
|
|
617
|
-
- For security, provider secrets are read from `NANOGPT_API_KEY`, `NANO_GPT_API_KEY`, your user/global OpenCode config, or `auth.json`. Repo-local `opencode.json` / `opencode.jsonc` is ignored for NanoGPT secrets.
|
|
618
|
-
- Allowed env templates are limited to `{env:NANOGPT_API_KEY}` and `{env:NANO_GPT_API_KEY}`.
|
|
619
|
-
- `/quota_status` prints a `nanogpt` section with API-key diagnostics, auth candidate paths, live subscription state, daily/monthly usage windows, endpoint errors, and balance details.
|
|
620
|
-
- NanoGPT quota reflects subscription-covered requests and account balance. It is not token-priced in `/tokens_*`.
|
|
443
|
+
Run `/quota_status` and check the Gemini CLI live probe rows.
|
|
621
444
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
"options": {
|
|
629
|
-
"apiKey": "{env:NANOGPT_API_KEY}",
|
|
630
|
-
},
|
|
631
|
-
},
|
|
632
|
-
},
|
|
633
|
-
}
|
|
634
|
-
```
|
|
445
|
+
| Symptom | Fix |
|
|
446
|
+
| --- | --- |
|
|
447
|
+
| Companion missing | Put `opencode-gemini-auth` before `@slkiser/opencode-quota` in `opencode.json`. |
|
|
448
|
+
| Provider not enabled in manual mode | Include `google-gemini-cli` in `experimental.quotaToast.enabledProviders`. |
|
|
449
|
+
| Auth missing | Run `opencode auth login --provider google`. |
|
|
450
|
+
| Project missing | Set `provider.google.options.projectId`, `OPENCODE_GEMINI_PROJECT_ID`, `GOOGLE_CLOUD_PROJECT`, or `GOOGLE_CLOUD_PROJECT_ID`. |
|
|
635
451
|
|
|
636
452
|
</details>
|
|
637
453
|
|
|
638
|
-
<a id="opencode-go-notes"></a>
|
|
639
|
-
|
|
640
454
|
<details>
|
|
641
455
|
<summary><strong>OpenCode Go</strong></summary>
|
|
642
456
|
|
|
643
|
-
|
|
457
|
+
Run `/quota_status` and check the `opencode_go` section.
|
|
644
458
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
**Troubleshooting:**
|
|
654
|
-
|
|
655
|
-
| Problem | Solution |
|
|
656
|
-
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
657
|
-
| Config not detected | Confirm `OPENCODE_GO_WORKSPACE_ID` and `OPENCODE_GO_AUTH_COOKIE` are set, then use `/quota_status` to inspect the exact config paths checked on your machine |
|
|
658
|
-
| Incomplete config | Both `workspaceId` and `authCookie` are required; check `/quota_status` for which field is missing |
|
|
659
|
-
| Scrape returns no data | The auth cookie may have expired; get a fresh one from your browser |
|
|
660
|
-
| Dashboard format changed | The SolidJS SSR pattern may have changed; file an issue or wait for the official API |
|
|
459
|
+
| Symptom | Fix |
|
|
460
|
+
| --- | --- |
|
|
461
|
+
| Config not detected | Set both `OPENCODE_GO_WORKSPACE_ID` and `OPENCODE_GO_AUTH_COOKIE`, then rerun `/quota_status`. |
|
|
462
|
+
| Incomplete config | `workspaceId` and `authCookie` must come from the same source. |
|
|
463
|
+
| Scrape returns no data | Refresh the browser `auth` cookie from `opencode.ai`. |
|
|
464
|
+
| Selected window missing | Check `/quota_status` for `selected_windows` and `live_fetch_error`; remove unavailable windows from `experimental.quotaToast.opencodeGoWindows` or refresh the dashboard cookie. |
|
|
465
|
+
| Dashboard format changed | This integration scrapes the dashboard, so it can break if the dashboard markup changes. |
|
|
661
466
|
|
|
662
467
|
</details>
|
|
663
468
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
All quota plugin settings live under `experimental.quotaToast` in `opencode.json` or `opencode.jsonc`.
|
|
667
|
-
|
|
668
|
-
Project/workspace config may override display-oriented settings for that project, but user/global config remains authoritative for automatic/network-affecting settings such as `enabled`, `enabledProviders`, `minIntervalMs`, `pricingSnapshot.*`, `showOnIdle`, `showOnQuestion`, `showOnCompact`, and `showOnBothFail`. SDK config is only used when no config files are found.
|
|
669
|
-
|
|
670
|
-
### Core/shared settings
|
|
671
|
-
|
|
672
|
-
| Option | Default | Meaning |
|
|
673
|
-
| ----------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
674
|
-
| `enabled` | `true` | Master switch for quota collection and handled slash commands. When `false`, `/quota`, `/quota_status`, `/pricing_refresh`, and `/tokens_*` are handled as no-ops. |
|
|
675
|
-
| `enabledProviders` | `"auto"` | Auto-detect providers, or set an explicit provider list. |
|
|
676
|
-
| `minIntervalMs` | `300000` | Minimum fetch interval between provider updates. |
|
|
677
|
-
| `formatStyle` | `singleWindow` | Shared quota-row style for popup toasts and the TUI sidebar: `singleWindow` (single window) or `allWindows` (all windows). Legacy `classic`/`grouped` aliases still work, and legacy `toastStyle` is still accepted on read for backward compatibility. |
|
|
678
|
-
| `percentDisplayMode` | `remaining` | Shared percent meaning for popup toasts and the TUI sidebar: `remaining` renders labels like `81% left`, while `used` renders labels like `19% used`; the bar fill always matches the shown meaning. |
|
|
679
|
-
| `onlyCurrentModel` | `false` | Filter quota rows to the current model/provider when that session selection can be resolved. |
|
|
680
|
-
| `showSessionTokens` | `true` | Show the `Session input/output tokens` section in quota displays when session token data is available. `allWindows` shows per-model rows on toast + sidebar, `singleWindow` shows a one-line total summary on both, and `/quota` keeps per-model rows. |
|
|
681
|
-
| `pricingSnapshot.source` | `"auto"` | Token pricing snapshot selection for `/tokens_*`: `auto`, `bundled`, or `runtime`. |
|
|
682
|
-
| `pricingSnapshot.autoRefresh` | `7` | Refresh stale local pricing data after this many days. |
|
|
683
|
-
|
|
684
|
-
`percentDisplayMode` affects popup toasts and the TUI sidebar only. `/quota` keeps its existing remaining-oriented percentage output. Value-only rows such as spend or used/limit summaries are unchanged.
|
|
685
|
-
|
|
686
|
-
Compatibility note: newer installs write canonical `formatStyle` values (`singleWindow` or `allWindows`). Legacy aliases (`classic`, `grouped`) and legacy `toastStyle` still normalize on read. Older plugin versions may not recognize the camelCase values and can fall back to their own default style in mixed-version rollback scenarios.
|
|
687
|
-
|
|
688
|
-
### Toast settings
|
|
689
|
-
|
|
690
|
-
| Option | Default | Meaning |
|
|
691
|
-
| ----------------- | ------- | ------------------------------------------------------------------------------- |
|
|
692
|
-
| `enableToast` | `true` | Show popup toasts. Disabling this does not disable `/quota` or the TUI sidebar. |
|
|
693
|
-
| `toastDurationMs` | `9000` | Toast duration in milliseconds. |
|
|
694
|
-
| `showOnIdle` | `true` | Show a toast on the idle trigger. |
|
|
695
|
-
| `showOnQuestion` | `true` | Show a toast after a question/assistant response. |
|
|
696
|
-
| `showOnCompact` | `true` | Show a toast after session compaction. |
|
|
697
|
-
| `showOnBothFail` | `true` | Show a fallback toast when providers attempted quota reads and all failed. |
|
|
698
|
-
| `layout.maxWidth` | `50` | Toast formatting width target. Ignored by the TUI sidebar. |
|
|
699
|
-
| `layout.narrowAt` | `42` | Toast compact-layout breakpoint. Ignored by the TUI sidebar. |
|
|
700
|
-
| `layout.tinyAt` | `32` | Toast tiny-layout breakpoint. Ignored by the TUI sidebar. |
|
|
701
|
-
| `debug` | `false` | Append toast debug context when troubleshooting. |
|
|
702
|
-
|
|
703
|
-
### TUI sidebar setup
|
|
704
|
-
|
|
705
|
-
If you want the `Quota` sidebar panel, you need **two files**:
|
|
706
|
-
|
|
707
|
-
1. **`tui.json` or `tui.jsonc`**: add the plugin entry so OpenCode mounts the sidebar panel.
|
|
708
|
-
2. **`opencode.json` or `opencode.jsonc`**: put all quota settings under `experimental.quotaToast`.
|
|
709
|
-
|
|
710
|
-
**Important:** `experimental.quotaToast.*` settings do **not** go in `tui.json`. `tui.json` is only for loading the TUI plugin.
|
|
711
|
-
|
|
712
|
-
| File | What goes there | Needed for sidebar? |
|
|
713
|
-
| ---------------------------------- | ---------------------------------------- | ------------------- |
|
|
714
|
-
| `tui.json` / `tui.jsonc` | `plugin: ["@slkiser/opencode-quota"]` | Yes |
|
|
715
|
-
| `opencode.json` / `opencode.jsonc` | All `experimental.quotaToast.*` settings | Yes |
|
|
716
|
-
|
|
717
|
-
### Provider-specific settings
|
|
718
|
-
|
|
719
|
-
| Option | Default | Meaning |
|
|
720
|
-
| ---------------------------- | ------------ | ---------------------------------------------------------------------------------------------------- |
|
|
721
|
-
| `anthropicBinaryPath` | `"claude"` | Command/path used for local Claude CLI probing; override this for custom installs or shim locations. |
|
|
722
|
-
| `googleModels` | `["CLAUDE"]` | Google model keys to query: `CLAUDE`, `G3PRO`, `G3FLASH`, `G3IMAGE`. |
|
|
723
|
-
| `alibabaCodingPlanTier` | `"lite"` | Fallback Alibaba Coding Plan tier when auth does not include `tier`. |
|
|
724
|
-
| `cursorPlan` | `"none"` | Cursor included API budget preset: `none`, `pro`, `pro-plus`, `ultra`. |
|
|
725
|
-
| `cursorIncludedApiUsd` | unset | Override Cursor monthly included API budget in USD. |
|
|
726
|
-
| `cursorBillingCycleStartDay` | unset | Local billing-cycle anchor day `1..28`; when unset, Cursor usage resets on the local calendar month. |
|
|
727
|
-
|
|
728
|
-
## Token Pricing Snapshot
|
|
729
|
-
|
|
730
|
-
`/tokens_*` uses a local `models.dev` pricing snapshot. A bundled snapshot ships for offline use, and Cursor `auto` and `composer*` pricing stays bundled because those ids are not on `models.dev`.
|
|
731
|
-
|
|
732
|
-
| `pricingSnapshot.source` | Active pricing behavior |
|
|
733
|
-
| ------------------------ | ----------------------------------------------------------------------------------------- |
|
|
734
|
-
| `auto` | Newer runtime snapshot wins; otherwise bundled pricing stays active. |
|
|
735
|
-
| `bundled` | Packaged bundled snapshot stays active. |
|
|
736
|
-
| `runtime` | Runtime snapshot stays active when present; bundled pricing is fallback until one exists. |
|
|
737
|
-
|
|
738
|
-
- See [Configuration Reference](#configuration-reference) for option defaults.
|
|
739
|
-
- `pricingSnapshot.autoRefresh` controls how many days a runtime snapshot can age before background refresh.
|
|
740
|
-
- `/pricing_refresh` refreshes only the local runtime snapshot under the OpenCode cache directory. It never rewrites the packaged bundled snapshot.
|
|
741
|
-
- If `pricingSnapshot.source` is `bundled`, `/pricing_refresh` still updates the runtime cache, but active pricing stays bundled.
|
|
742
|
-
- Reports keep working if refresh fails.
|
|
743
|
-
- Pricing selection stays local and deterministic. There are no custom URLs or arbitrary pricing sources.
|
|
744
|
-
|
|
745
|
-
## Troubleshooting
|
|
746
|
-
|
|
747
|
-
If something is missing or looks wrong:
|
|
748
|
-
|
|
749
|
-
1. Run `/quota_status`.
|
|
750
|
-
2. Confirm the expected provider appears in the detected provider list.
|
|
751
|
-
3. If token reports are empty, make sure OpenCode has already created `opencode.db`.
|
|
752
|
-
4. If Copilot managed billing is expected, confirm `copilot-quota-token.json` is present and valid.
|
|
753
|
-
5. If provider setup looks wrong, check [Provider Setup At A Glance](#provider-setup-at-a-glance) and [Provider-Specific Notes](#provider-specific-notes). For Google Antigravity or Qwen Code, confirm the companion auth plugin is installed. For Alibaba Coding Plan, confirm OpenCode `alibaba` or `alibaba-coding-plan` auth is configured; `tier` may be `lite` or `pro`, and if it is missing the plugin falls back to `experimental.quotaToast.alibabaCodingPlanTier`.
|
|
469
|
+
<details>
|
|
470
|
+
<summary><strong>Token Reports</strong></summary>
|
|
754
471
|
|
|
755
|
-
|
|
472
|
+
Run `/quota_status` and check pricing snapshot health plus OpenCode database paths.
|
|
756
473
|
|
|
757
|
-
|
|
474
|
+
| Symptom | Fix |
|
|
475
|
+
| --- | --- |
|
|
476
|
+
| `/tokens_*` is empty | Start OpenCode once so it creates `opencode.db`, then run a session with model usage. |
|
|
477
|
+
| Pricing looks stale | Run `/pricing_refresh`. |
|
|
478
|
+
| Runtime pricing does not change output | Check `experimental.quotaToast.pricingSnapshot.source`; `bundled` keeps packaged pricing active. |
|
|
479
|
+
| Cursor model has unknown pricing | Run `/pricing_refresh`; Cursor `auto` and `composer*` use bundled deterministic pricing. |
|
|
758
480
|
|
|
759
|
-
|
|
481
|
+
</details>
|
|
760
482
|
|
|
761
|
-
|
|
483
|
+
### License
|
|
762
484
|
|
|
763
485
|
MIT
|
|
764
486
|
|
|
765
|
-
|
|
487
|
+
### Remarks
|
|
766
488
|
|
|
767
489
|
OpenCode Quota is not built by the OpenCode team and is not affiliated with OpenCode or any provider listed above.
|
|
768
490
|
|
|
769
|
-
|
|
770
|
-
[](https://www.star-history.com/?repos=slkiser%2Fopencode-quota&type=date&legend=bottom-right)
|
|
771
|
-
|
|
491
|
+
### Star History
|
|
772
492
|
|
|
493
|
+
[](https://www.star-history.com/?repos=slkiser%2Fopencode-quota&type=date&legend=bottom-right)
|