quota-axi

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

quota-axi

quota-axi

Report local agent-provider quota windows and model quota evidence.
You do not need quota-axi installed globally - invoke it with
npx -y quota-axi
.
quota-axi is data only: it never routes, recommends a provider, model, harness, credential, or route, proxies, intercepts, logs in, imports browser cookies, or mutates provider state. Default output has no ordering preference. The explicit
models --sort runway
comparator only orders quota evidence, preserves ties, and is never a recommendation. It reads local provider auth sources and calls first-party provider quota, usage, billing, or entitlement endpoints; it never launches the Claude, Grok, Pi, or Kimi CLIs, so it cannot spend the quota it measures.
报告本地Agent服务商的配额周期及模型配额相关信息。
无需全局安装quota-axi——直接使用
npx -y quota-axi
调用即可。
quota-axi仅提供数据:它从不进行路由、推荐服务商、模型、工具、凭证或路由配置,也不代理、拦截请求、登录、导入浏览器Cookie或修改服务商状态。默认输出无排序偏好。显式的
models --sort runway
比较器仅对配额信息进行排序,保留并列结果,绝非推荐。它读取本地服务商认证源并调用官方服务商的配额、使用量、计费或权益端点;它绝不会启动Claude、Grok、Pi或Kimi的CLI,因此不会消耗其测量的配额。

When to use

使用场景

Use quota-axi whenever you need local quota headroom before deciding whether it is safe to keep working on a provider, when the user asks about usage, rate limits, or remaining quota, or when comparing supported local provider headroom side by side.
当你需要了解本地剩余配额以判断是否可以继续使用某服务商服务时、用户询问使用量、速率限制或剩余配额时,或是需要并排对比支持的本地服务商剩余配额空间时,均可使用quota-axi。

Workflow

工作流程

  1. Run
    npx -y quota-axi
    for compact TOON output covering supported providers' quota windows.
  2. Scope to one provider with
    --provider claude
    or to a subset with
    --provider cursor,copilot,grok,kimi
    .
  3. Pass
    --json
    for the normalized machine-readable model instead of TOON. Read
    quotaSemantics.effectiveAvailability
    rather than treating a model window in isolation: account windows can bound every model, and
    boundedBy
    names every window included in the effective percentage. Read
    effectiveAvailability[].runway
    first for completion-risk evidence across every authoritative bound:
    projected_exhaustion
    supplies the earliest finite
    usableRunwaySeconds
    ,
    projectedExhaustedAt
    , limiting window, and confidence;
    through_reset
    deliberately has no synthetic deadline;
    exhausted_now
    is zero runway; and
    unknown
    names unmeasurable bounds instead of inventing a conclusion. Read each window's
    pace
    (and the effective scope's pace summary) for diagnostics. Default TOON omits raw numeric reserve;
    --json
    and
    --full
    retain it. If relationship status is
    partial
    or
    unknown
    , do not infer one. Stale reports keep raw windows for diagnostics, but effective availability, pace, and runway are always unknown; never route from a stale raw percentage as though it were current headroom. Default output has no ordering preference. For a provider-native model evidence join, use
    npx -y quota-axi models --intelligence high --json
    . This catalog covers Claude, Codex, Grok, and Kimi only; its buckets are coarse editorial classifications, not scores. Its response includes catalog provenance and unmatched model windows.
    --sort runway
    is an explicit, documented quota-evidence comparator, not a provider, model, harness, credential, or route recommendation; inspect
    sort.tieGroups
    rather than treating equal evidence as a preference.
  4. Pass
    --full
    to include account identity, per-source attempts, and raw reserve diagnostics.
  5. Run
    npx -y quota-axi auth
    to check local auth-source availability without printing secret values.
  6. On macOS, Claude Keychain value reads are pinned to the same validated current-user account Claude Code selects and are skipped by default until the user grants access once. If quota output reports
    reason: keychain_access_required
    , tell your user to run
    quota-axi --allow-keychain-prompt
    once and approve Keychain access ("Always Allow"). After that successful grant, plain
    quota-axi
    calls reuse the existing Keychain access marker, scoped to both profile and account, to refresh live Claude quota without requiring the flag. Legacy markers are not reused, so an upgrade may require this one-time grant again.
  7. For Grok, read
    state.authStatus
    before any logout wording.
    expired_refreshable
    means a local session still looks signed in but short-lived access expired. Only when quota-axi also emits
    reason: credentials_expired
    /
    remedyCommand: grok
    should you tell your user to open the Grok CLI once; Pi-only expiry has no Grok remedy because Grok cannot refresh Pi-owned credentials. Do not treat soft expiry as full sign-out, and do not ask quota-axi to refresh credentials - it never launches Grok or Pi or writes auth files.
    authStatus: usable
    with empty windows means model auth is present (Grok CLI and/or Pi
    xai
    ) while consumer credit windows are unknown - not logged out. Reserve true sign-in recovery for
    authStatus: unusable
    /
    Grok sign-in required
    .
  8. For a managed Codex installation, set
    QUOTA_AXI_CODEX_BINARY
    to its absolute executable path. quota-axi uses that exact executable for auth inspection and the read-only app-server fallback, and fails closed if the override is invalid. Codex OAuth availability follows the access token, not id_token expiry alone.
  9. For Kimi, quota-axi prefers a literal Pi-managed
    kimi-coding
    API key from
    $PI_CODING_AGENT_DIR/auth.json
    (default
    ~/.pi/agent/auth.json
    ). If it is unavailable, quota-axi may reuse a fresh official Kimi Code CLI access token from
    $KIMI_CODE_HOME/credentials/kimi-code.json
    (default
    $HOME/.kimi-code/credentials/kimi-code.json
    ) without refreshing or writing credentials. Grok also reads that same Pi auth file for an independent
    xai
    OAuth or literal API-key entry and treats Grok as usable when either the Grok CLI session or Pi
    xai
    credential is valid.
  1. 运行
    npx -y quota-axi
    获取简洁的TOON格式输出,涵盖所有支持服务商的配额周期信息。
  2. 使用
    --provider claude
    指定单个服务商,或使用
    --provider cursor,copilot,grok,kimi
    指定部分服务商。
  3. 传递
    --json
    参数获取标准化的机器可读模型,而非TOON格式。应读取
    quotaSemantics.effectiveAvailability
    而非孤立看待单个模型周期:账户周期可能限制所有模型,
    boundedBy
    会列出有效占比中包含的所有周期。首先读取
    effectiveAvailability[].runway
    以获取跨所有权威限制的耗尽风险信息:
    projected_exhaustion
    提供最早的有限
    usableRunwaySeconds
    projectedExhaustedAt
    、限制周期及置信度;
    through_reset
    无合成截止时间;
    exhausted_now
    表示剩余时长为零;
    unknown
    表示无法测量的限制,而非凭空生成结论。读取每个周期的
    pace
    (及有效范围的速率摘要)用于诊断。默认TOON输出会省略原始数值储备;
    --json
    --full
    参数会保留该信息。若关联状态为
    partial
    unknown
    ,请勿进行推断。过期报告保留原始周期用于诊断,但有效可用性、速率和剩余时长始终为未知;切勿将过期的原始占比当作当前剩余配额进行路由决策。默认输出无排序偏好。如需服务商原生模型信息关联,使用
    npx -y quota-axi models --intelligence high --json
    。该目录仅覆盖Claude、Codex、Grok和Kimi;其分类为粗略的编辑分类,而非评分。响应包含目录来源及未匹配的模型周期。
    --sort runway
    是显式、有文档记录的配额信息比较器,而非服务商、模型、工具、凭证或路由推荐;请查看
    sort.tieGroups
    ,勿将相同信息视为偏好。
  4. 传递
    --full
    参数以包含账户身份、各源尝试次数及原始储备诊断信息。
  5. 运行
    npx -y quota-axi auth
    检查本地认证源可用性,且不会打印敏感值。
  6. 在macOS上,Claude钥匙串值读取与Claude Code选择的已验证当前用户账户绑定,默认会跳过,直到用户授予一次访问权限。若配额输出显示
    reason: keychain_access_required
    ,请告知用户运行一次
    quota-axi --allow-keychain-prompt
    并批准钥匙串访问(选择“始终允许”)。成功授权后,普通的
    quota-axi
    调用会重用现有的钥匙串访问标记(按配置文件和账户范围),无需该标志即可刷新Claude的实时配额。旧标记无法重用,因此升级后可能需要再次进行此一次性授权。
  7. 对于Grok,请先查看
    state.authStatus
    再进行任何登出相关操作。
    expired_refreshable
    表示本地会话仍显示已登录,但短期访问权限已过期。只有当quota-axi同时输出
    reason: credentials_expired
    /
    remedyCommand: grok
    时,才需告知用户打开一次Grok CLI;仅Pi的过期情况无Grok解决方法,因为Grok无法刷新Pi所有的凭证。请勿将软过期视为完全登出,也不要要求quota-axi刷新凭证——它绝不会启动Grok或Pi,也不会写入认证文件。
    authStatus: usable
    但周期为空表示存在模型认证(Grok CLI和/或Pi
    xai
    ),但消费者信用周期未知——并非已登出。仅当
    authStatus: unusable
    /
    Grok sign-in required
    时才需进行真正的登录恢复操作。
  8. 对于托管的Codex安装,请将
    QUOTA_AXI_CODEX_BINARY
    设置为其绝对可执行文件路径。quota-axi会使用该精确可执行文件进行认证检查和只读应用服务器回退,若覆盖路径无效则会终止运行。Codex OAuth可用性遵循访问令牌,而非仅id_token过期时间。
  9. 对于Kimi,quota-axi优先使用Pi管理的
    kimi-coding
    API密钥,该密钥位于
    $PI_CODING_AGENT_DIR/auth.json
    (默认路径为
    ~/.pi/agent/auth.json
    )。若该密钥不可用,quota-axi可能会重用来自
    $KIMI_CODE_HOME/credentials/kimi-code.json
    (默认路径为
    $HOME/.kimi-code/credentials/kimi-code.json
    )的最新官方Kimi Code CLI访问令牌,且不会刷新或写入凭证。Grok也会读取同一Pi认证文件中的独立
    xai
    OAuth或明文API密钥条目,当Grok CLI会话或Pi
    xai
    凭证任一有效时,即视为Grok可用。

Usage

使用方法

usage: quota-axi [quota|auth|models] [flags]
commands[3]:
  (none)=quota, auth, models
output:
  Default TOON reports local quota evidence. models is a deterministic data join; --sort runway is explicit opt-in ordering. --tui renders a live human terminal report instead (q quits).
flags[11]:
  --provider <claude,codex,cursor,copilot,grok,kimi>, --json, --full, --tui, --refresh <30s-24h>, --once, --allow-keychain-prompt, --intelligence <high|medium|low>, --sort <runway>, --help, -v/--version
examples:
  quota-axi
  quota-axi --provider claude
  quota-axi --provider cursor,copilot,grok,kimi
  quota-axi --json
  quota-axi --full
  quota-axi --tui
  quota-axi --tui --refresh 1m
  quota-axi --tui --once
  quota-axi auth
  quota-axi models --intelligence high
  quota-axi models --sort runway
usage: quota-axi [quota|auth|models] [flags]
commands[3]:
  (none)=quota, auth, models
output:
  Default TOON reports local quota evidence. models is a deterministic data join; --sort runway is explicit opt-in ordering. --tui renders a live human terminal report instead (q quits).
flags[11]:
  --provider <claude,codex,cursor,copilot,grok,kimi>, --json, --full, --tui, --refresh <30s-24h>, --once, --allow-keychain-prompt, --intelligence <high|medium|low>, --sort <runway>, --help, -v/--version
examples:
  quota-axi
  quota-axi --provider claude
  quota-axi --provider cursor,copilot,grok,kimi
  quota-axi --json
  quota-axi --full
  quota-axi --tui
  quota-axi --tui --refresh 1m
  quota-axi --tui --once
  quota-axi auth
  quota-axi models --intelligence high
  quota-axi models --sort runway

Tips

提示

  • Output is TOON-encoded and token-efficient by default; pass
    --json
    only when you need the normalized schema.
  • Exit code 0 means at least one provider returned data (fresh or stale); exit code 1 means every provider failed; exit code 2 means a usage error.
  • Percentages are not comparable across providers - quota-axi never claims one provider's percentage equals another's.
  • Claude
    --full
    output exposes the authoritative OAuth profile
    account.uuid
    as
    account.accountId
    when Anthropic returns one; otherwise the account identity is explicitly marked unverified rather than inferred.
  • The quota cache at
    ~/.cache/quota-axi/quotas.json
    only ever holds normalized non-secret snapshots. Fresh provider reports with no windows clear stale provider snapshots instead of caching empty quota. Claude local expiry metadata is advisory when an access token exists: the existing read-only usage request decides validity. Missing or invalid credentials without a usable token and HTTP 401/403 retire Claude cache; only transient failures may use bounded, reset-pruned stale data. The Claude Keychain access marker lives alongside it, is scoped by hashed profile and account hashes, and contains no credential values or raw account name.
  • 默认输出为TOON编码,令牌效率高;仅当需要标准化 schema 时才传递
    --json
    参数。
  • 退出码0表示至少有一个服务商返回数据(新鲜或过期);退出码1表示所有服务商均失败;退出码2表示使用错误。
  • 不同服务商的占比不可直接比较——quota-axi绝不会声称某服务商的占比等同于另一服务商。
  • 当Anthropic返回相关信息时,Claude的
    --full
    输出会将权威OAuth配置文件
    account.uuid
    显示为
    account.accountId
    ;否则账户身份会被明确标记为未验证,而非推断得出。
  • 配额缓存位于
    ~/.cache/quota-axi/quotas.json
    ,仅存储标准化的非敏感快照。 无周期信息的新鲜服务商报告将清除过期的服务商快照,而非缓存空配额。 当存在访问令牌时,Claude本地过期元数据仅为参考:现有的只读使用量请求会决定有效性。缺少或无效凭证且无可用令牌,以及HTTP 401/403错误会使Claude缓存失效;仅临时故障可使用有限的、经过重置修剪的过期数据。 Claude钥匙串访问标记与其并存,按哈希后的配置文件和账户哈希进行范围限定,不包含凭证值或原始账户名称。