3.4.0-beta.1). Tính năng có thể thay đổi trước bản stable tiếp theo.Chuyển sang stable →usage
ak usage limits
Xem các cửa sổ giới hạn sử dụng theo provider: token cục bộ trong 5 giờ và 7 ngày cho Claude và Codex; phần trăm do provider báo, cùng dữ liệu Cursor và Grok, đến từ advanced polling (mặc định bật).
Xem các cửa sổ giới hạn sử dụng theo provider: token cục bộ trong 5 giờ và 7 ngày cho Claude và Codex; phần trăm do provider báo, cùng dữ liệu Cursor và Grok, đến từ advanced polling (mặc định bật).
Dùng ak usage limits với đối số và tùy chọn dưới đây. Phần help nguyên bản giữ nguyên thuật ngữ, cú pháp, tác động và điều kiện thực thi của CLI để đối chiếu chính xác.
Contract và help của lệnh
Show usage-limit windows per provider
Synopsis
Sums local session-token facts inside the trailing 5-hour and 7-day rolling windows for Claude and Codex and reports both windows with a raw_only provenance. Every fact is counted under the window that contains the session's start (session-start attribution). Provider polling is on by default for every provider (claude, codex, cursor, grok) and reuses the sign-in each official CLI already stored: rows the provider reported carry provider_reported provenance, the provider's used percent, and the source endpoint; a failed poll keeps the local counts and records a degrade_reason. Turn polling off in the dashboard settings to keep every surface local-only; that choice is sticky (it records usage_limits.opted_out_at), and turning polling back on asks for the risk acknowledgement again. When editing the config by hand, set usage_limits.advanced.enabled: false together with usage_limits.opted_out_at (an RFC 3339 time); a false with neither usage_limits.opted_out_at nor usage_limits.ack_last_at is read as the legacy default and polling stays on. Set AGENTKIT_USAGE_LIMITS_LOCAL_ONLY=1 to force local-only for one process. Cursor (monthly billing cycle) and Grok (weekly billing cycle) keep no local data, so their rows stay empty while they are not polled: degrade_reason advanced_required when polling is off, provider_disabled when polling is on but their own provider switch is off. Claude and Codex rows also carry cost_usd, the equivalent API cost of their local tokens at the public rates embedded in this build (cost_as_of names the rate date); it is an estimate for comparison, not a bill. With polling on, a provider that names its plan labels its rows with plan_preset and plan_preset_auto_detected unless plan detection is switched off in settings. Use it before starting a long session, when tuning agent runs, or when a downstream dashboard needs the same numbers the desktop popover shows.
Effects: Reads local data; may record a provider auto-disable in the AgentKit config. Opens the local analytics SQLite index under ~/.agentkit/analytics/ in read-only mode; AGENTKIT_HOME overrides the base dir. A cold or absent index yields zeroed windows, not an error. Unless polling is off or AGENTKIT_USAGE_LIMITS_LOCAL_ONLY=1 is set, each enabled provider gets one usage request per poll (plus one plan lookup for Cursor and Grok) sent to that provider's usage endpoint with the access token its official app or CLI already stored, rate-limited to a burst of three polls per minute, and it never refreshes or writes a token. On macOS the first Claude or Cursor poll may show the system's one-time keychain access prompt. When an endpoint rejects the stored token or the keychain prompt is denied, that one provider is switched off in the AgentKit config (usage_limits.advanced.auto_disabled names the reason) so the prompt is not repeated, until you turn it back on; that is the only write this command makes. Reading the Cursor token copies Cursor's state database into a private temporary directory that is removed afterwards.
Exit status: 0 success, 1 command failure, 2 invalid flags or arguments
ak usage limits [flags]Examples
ak usage limits
ak usage limits --json
ak usage limits --provider claude --window 5h
ak usage limits --provider cursor --window monthlyOptions
-h, --help help for limits
--json Emit machine-readable JSON (implies --no-interactive)
--no-interactive Disable interactive prompts (CI-safe)
--provider string Provider to query: claude, codex, cursor, grok, or all (default "all")
-q, --quiet Suppress non-error output on stderr
-V, --verbose Extra diagnostic output on stderr (loses to --quiet)
--window string Window: 5h, week, monthly, or all (default "all")
-y, --yes Assume yes for all promptsSEE ALSO
- ak usage - Inspect local token usage and per-provider usage limits