Repository navigation
Description
Area
CLI
What are you trying to accomplish?
I run three Anthropic OAuth logins in the account pool and need to know, before I start a long session, which one still has headroom. The decision needs each account's own 5-hour and weekly bars — not the pool's active account alone — so I can switch to the account that will survive the session instead of hitting a limit mid-run and rotating under load.
What prevents this today?
The proxy already computes exactly this data, and the dashboard already shows it, but no CLI command exposes it.
src/providers/quota.ts:1561exportsfetchProviderAccountQuotas(provider, forceRefresh), which probeshttps://api.anthropic.com/api/oauth/usageonce per stored credential and returns a per-account 5h/weekly/Opus/Sonnet breakdown.src/server/management/oauth-account-routes.ts:270exposes it asGET /api/oauth/accounts?provider=anthropic"a=1(with&refresh=1to bypass the TTL).gui/src/hooks/useProviderAccountPools.ts:100consumes that endpoint, so the dashboard renders per-account bars.supportsPerAccountQuota()atsrc/providers/quota.ts:1396gates it toanthropictoday.
The CLI never passes quota=1. fetchOAuthRows() at src/cli/account-api.ts:246 requests /api/oauth/accounts?provider=<name> with no quota parameter, so ocx account list anthropic returns id/label/active only, and --json has no quota field either. ocx account list --quota is rejected as an unknown flag.
The adjacent commands do not fill the gap:
ocx account refresh anthropicreports one line, and it is the active account's usage only.ocx provider quotais also active-account-only for Anthropic (and separately mis-renders — seeocx provider quotaprints only a report count, dropping every fetched quota bar #2565).
So a headless or SSH session, or any agent operating the proxy, cannot answer "which Anthropic account has quota left" without hand-rolling an authenticated curl against the management API and reading the admin token off disk. That is the workaround I am using today, and it should not be the supported path for data the dashboard shows in one click.
What should OpenCodex do?
Add a per-account quota projection to the account list for providers where supportsPerAccountQuota() is true:
ocx account list <provider> --quotarequestsquota=1and prints each account's windows on its row;--refresh(or--quota=refresh) maps torefresh=1for a forced probe;--jsonincludes the per-accountquotaobject and thequotaUnavailablemarker the endpoint already returns;- without
--quotathe command stays a cheap local read with no network probe, matching the endpoint's existing opt-in design; - for a provider without per-account support, the flag reports that plainly rather than silently printing bare rows.
Reuse quotaParts() from src/cli/account-extended.ts:267 so the rendering matches ocx account refresh. No new probe logic is needed — this is a CLI projection over an endpoint that already exists and is already exercised by the GUI.
Example usage or interface
Today:
$ ocx account list anthropic
PROVIDER TYPE ID PLAN/LABEL PRIORITY STATUS
anthropic oauth 1278f8da a***[email protected] -
anthropic oauth e112f28b k***[email protected] -
anthropic oauth b245be97 l***[email protected] - active
$ ocx account list anthropic --quota
Unknown flag(s): --quotaProposed:
$ ocx account list anthropic --quota
PROVIDER TYPE ID PLAN/LABEL STATUS QUOTA
anthropic oauth 1278f8da a***[email protected] - 5h 100% resets 2026-08-25T15:00:00Z weekly 61% resets 2026-08-28T23:00:00Z
anthropic oauth e112f28b k***[email protected] - 5h 0% weekly 44% resets 2026-08-28T15:00:00Z
anthropic oauth b245be97 l***[email protected] active 5h 5% resets 2026-08-25T16:39:59Z weekly 98% resets 2026-08-26T01:59:59ZThat output makes the operational decision obvious: the active account is at 98% weekly, and ocx account use anthropic e112f28b is the right move.
Alternatives or workarounds
Reading the admin token off disk and calling the management API directly:
curl -s -H "Authorization: Bearer $(cat ~/.opencodex/admin-api-token)" \
'http://127.0.0.1:10100/api/oauth/accounts?provider=anthropic"a=1&refresh=1'This works and returns the full per-account payload, but it requires knowing the runtime port, handling the admin token in shell, and parsing JSON by hand — none of which a CLI user should need for a read the dashboard performs routinely.
Opening the dashboard is not an alternative for headless, SSH, or agent-driven use.
Additional context
- The output formatting depends on the same renderer discussed in
ocx provider quotaprints only a report count, dropping every fetched quota bar #2565; fixing that first makes this a small addition rather than a new formatter. supportsPerAccountQuota()is currentlyanthropic-only, so this proposal is scoped to Anthropic today and inherits any future provider that opts in, with no per-provider CLI work.- Related but distinct: [Feature]: Allow Anthropic account-pool quota routing to select by weekly usage #2539 asks for weekly-usage-aware routing selection; this asks only for visibility. The two are complementary — an operator should be able to read the same numbers the router would act on.
Checks
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
Activity
lidge-jun commentedon Aug 25, 2026
리뷰 · 우선순위 55 / 80
설명: 이 이슈는 ocx account list 가 앤트로픽 계정마다 5시간/주간 막대를 보여 달라고 한다. 작성자는 lidge-jun 이다. 지금 열려 있다. 라벨은 enhancement, account-pool, cli, proxy 다. 지금 CURRENT
devHEAD 는 e1fb675 이다. 이번 시간에 SHA 는 안 움직였다. origin/dev package.json 은 2.32.1-preview.20260825 다. 차량 풀은 아직 없다. 표시만 요구한다. 라우터를 바꾸라고 하지 않는다. 내가 구현하지 않고 머지하지 않는다.HEAD 에서 빈 자리는 확인된다. src/cli/account.ts 18-19줄 사용법은 list [provider] [--json] [--all] 만 허용한다. 96-104줄 cmdList 는 leftoverArgsError 로 --quota 를 Unknown flag(s) 로 거절한다. src/cli/account-api.ts 245-246줄 fetchOAuthRows 는 /api/oauth/accounts?provider= 만 부르고 quota=1 을 안 붙인다. 그래서 리스트와 --json 모두 계정 쿼터 칸이 없다. ocx account refresh 는 활성 계정 한 줄만 찍는다.
프록시와 대시보드는 이미 그 숫자를 갖고 있다. src/providers/quota.ts 1396-1398줄 supportsPerAccountQuota 는 오늘 anthropic 만 참이다. 1561-1576줄 fetchProviderAccountQuotas 가 계정마다 프로브한다. src/server/management/oauth-account-routes.ts 274-296줄 GET /api/oauth/accounts 는 ?quota=1 일 때만 프로브하고, ?refresh=1 이면 TTL 을 건너뛴다. 칸이 없으면 값싼 로컬 읽기다. gui/src/hooks/useProviderAccountPools.ts 가 그 엔드포인트를 쓴다. 이 이슈는 CLI 가 같은 옵트인을 노출하라는 것이다.
제안은 범위가 작다. --quota 가 quota=1 을 붙이고, --refresh 가 refresh=1 을 붙이고, --json 이 quota 와 quotaUnavailable 을 실어 나른다. 플래그 없으면 네트워크 프로브를 하지 않는다. 지원하지 않는 공급자는 조용히 빈 칸이 아니라 지원하지 않는다고 말해야 한다. 렌더러는 src/cli/account-extended.ts 267줄 quotaParts 를 재사용한다. 2565 가 그 줄을 provider quota 텍스트에도 쓰자고 한다. 2565 를 먼저 고치면 이 이슈는 리스트 플래그만 남는다. 두 이슈를 서로 닫지 말 것.
2539 는 라우터가 주간 창으로 고르는 일이다. 이 이슈는 사람이 같은 숫자를 읽게 하는 일이다. 2539 를 이 이슈로 닫지 말 것. 2560 이 2539 의 차량이다. 2562 는 구글 풀이다. 이 이슈로 닫지 말 것. 695 도 연다. src/runtime 은 없다. default-aliases.ts 와 model-presets.ts 도 없다. 2463 2464 2465 를 닫지 말 것. 프리뷰 배포가 아니다. 내가 이 이슈를 닫지 않는다.
라인 19 - src/cli/account.ts 사용법에 --quota 가 없다
라인 100 - src/cli/account.ts leftoverArgsError 가 --quota 를 거절한다
라인 246 - src/cli/account-api.ts fetchOAuthRows 가 quota=1 을 안 붙인다
라인 1396 - src/providers/quota.ts supportsPerAccountQuota 는 anthropic 만 참이다
라인 277 - src/server/management/oauth-account-routes.ts 가 이미 ?quota=1 옵트인이다
2565 - 같은 렌더러의 버그다. 이 이슈로 닫지 말 것. 먼저 고치면 재사용이 쉽다
2539 - 라우팅이다. 표시가 아니다. 닫지 말 것
메인테이너의 판단이 필요한 지점
너의 추천
기능으로 받는다. ocx account list --quota 가 기존 GET quota=1 을 투영하게 한다. 기본 list 는 값싼 로컬 읽기로 둔다. 2565 렌더러를 재사용한다. 2539 와 695 와 2562 는 이 이슈로 닫지 말 것. 내가 구현하지 않는다. 라벨은 그대로 둔다. 프리뷰 배포가 아니다.
이 댓글은 grok-bot이 작성했습니다
lidge-jun commentedon Aug 25, 2026
Shipped on
devin #2587.ocx account list --quotanow adds a QUOTA column, with--refreshto bypass the cached probe. It is opt-in for the reason you identified: the server probes the upstream once per stored credential, so the default listing stays a local read.Verified against your three Anthropic logins — it produces exactly the decision the issue describes, with the active account at 45% weekly while a sibling sits at 98%.
Two small calls I made along the way: an unprobed provider shows
-and a failed probe showsunavailable, since blank would read as no usage rather than not measured. And two DTO spellings reach the same field (the per-account probe reportsfiveHourPercent, the Codex pool reportsshortPercent), so both render as5h. Docs updated.