> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bastani.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Check subscription usage

> See how much of your AI subscriptions you have used, when limits reset, and where to adjust ChatGPT app limits.

Type `/usage` during a chat to see how much of each signed-in subscription’s allowance you have used and when it resets, without interrupting a reply.

```text theme={null}
Subscription usage

  OpenAI · openai
    Usage limit reached
    Your ChatGPT plan or app usage limit has been reached.
    Manage usage: chatgpt.com/settings/usage

  Anthropic account 2 · anthropic-2
    Session (5h)  ███████████░  96% used  Resets in 1h 12m

    Weekly (7d)   ████████░░░░  71% used  Resets in 3d 20h

  GitHub Copilot · github-copilot
    Premium requests  ███████░░░░░  60% used  Resets in 14d 6h

  Z.AI · zai
    Session (5h)  ██░░░░░░░░░░  16% used  Resets in 4h 12m

    Weekly (7d)   █░░░░░░░░░░░  4% used   Resets in 6d 18h

  ↑↓ scroll · m manage usage · r refresh · esc cancel
```

## Reading the panel

* **Most urgent accounts appear first.** Accounts that have hit a usage limit appear at the very top, followed by accounts with the highest usage percentage, then accounts with unlimited or non-percentage allowances. When two accounts tie, the one used in the current chat comes first, then the rest alphabetically. Accounts with no figures yet appear last.
* **Colour, plain-text warnings, and unlimited plans.** Each metered bar shows the percentage used and how long until it resets. Bars highlight at 80% and again at 95%. When colour is turned off, `!` marks 80% or more and `!!` marks 95% or more (as well as reached limits). Unlimited allowances (such as unlimited GitHub Copilot Chat, Completions, or Premium requests) appear as **Unlimited** instead of a percentage bar.
* **Live updates across sessions and restarts.** New figures appear automatically while `/usage` is open, even when only a subagent used the account. Atomic remembers the latest figures across restarts. Once a limit’s reset time has passed, Atomic shows `0% used` instead of outdated numbers.
* **Keyboard shortcuts.** Use `↑`/`↓` to scroll a line, `PgUp`/`PgDn` to scroll a page, and `Home`/`End` to jump to the top or bottom. Press `m` to open **Manage usage** in your browser when shown in the footer, `r` to refresh live figures, or `Esc` / `Ctrl+C` to close the panel without stopping an active reply.

Checking usage never spends reset credits or counts toward your usage allowance. To see token counts and costs for the current conversation, use `/session` instead.

## Supported accounts

`/usage` shows your signed-in subscription accounts across these providers (including additional account aliases you configure):

| Provider | What Atomic checks | Supported sign-in methods |
| - | - | - |
| **Anthropic (Claude)** | 5-hour session, weekly, per-model weekly, and extra usage | Claude subscription sign-in (`/login anthropic`), setup token (`sk-ant-oat…`), or `ANTHROPIC_OAUTH_TOKEN` |
| **OpenAI Codex** | 5-hour session, weekly, additional limits, and credits | ChatGPT Codex sign-in (`/login openai-codex`) |
| **OpenAI (Sign in with ChatGPT)** | Limit-reached status and link to ChatGPT usage settings (plus any usage figures OpenAI returns on responses) | Sign in with ChatGPT (`/login openai`) |
| **GitHub Copilot** | Monthly premium requests, chat, and completions | GitHub Copilot sign-in (`/login github-copilot`), GitHub token saved through `/login`, or `COPILOT_GITHUB_TOKEN` (personal/org/business accounts on `github.com`) |
| **Kimi For Coding** | 5-hour session, weekly, and monthly total quota | Kimi Code sign-in (`/login kimi-coding`), saved Kimi API key, or `KIMI_API_KEY` |
| **Z.AI and Z.AI Coding CN** | 5-hour session, weekly, and monthly MCP tool call limits | Saved API key (`/login zai` or `/login zai-coding-cn`), `ZAI_API_KEY`, or `ZAI_CODING_CN_API_KEY` |
| **xAI (Grok)** | Weekly and monthly plan usage | Grok/X subscription sign-in (`/login xai`) |
| **OpenRouter** | Spending cap and daily, weekly, and monthly totals | OpenRouter account sign-in (`/login openrouter`) |

> [!NOTE]
>
> Pay-per-token API keys (such as an OpenAI API key, an Anthropic `sk-ant-api…` key, or a custom proxy key in `models.json`) are billed per token rather than against a subscription allowance, so they do not appear in `/usage`. GitHub Enterprise hosts, custom proxy URLs, and short-lived exchanged Copilot session tokens (`tid=…`) also show as **Not available** so Atomic never sends private or enterprise tokens to the wrong host.

## When a ChatGPT plan reaches its limit

When you sign in to OpenAI with **Sign in with ChatGPT** (`/login openai`), OpenAI manages your plan allowance and per-app limits in [ChatGPT Settings → Usage](https://chatgpt.com/settings/usage) rather than through a live percentage meter.

* **Normal state:** Atomic displays a link to **ChatGPT Settings → Usage** so you can check your allowance or adjust the limit you gave Atomic at any time.
* **Usage limit reached:** If a request fails because your ChatGPT plan or per-app limit was reached, Atomic displays a **Usage limit reached** notice in the chat and remembers that state in `/usage`, `atomic usage`, RPC, and the SDK — even after a restart or if a subagent hit the limit. Because the limit may be an app-specific cap rather than your entire ChatGPT plan, Atomic does not guess a reset time. Click **Manage usage** or press `m` inside `/usage` to open [ChatGPT Settings → Usage](https://chatgpt.com/settings/usage).
* **Workspace limits:** On a ChatGPT Business plan where your workspace admin controls per-user limits, Atomic tells you to ask your workspace admin to increase the limit at `admin.openai.com` instead of sending you to personal settings.
* **Automatic recovery:** As soon as a later request on that account succeeds (for example after you raise the app limit or your window resets), Atomic automatically clears the remembered **Usage limit reached** status.

## Check from a script or terminal

```bash theme={null}
atomic usage
atomic usage --json
```

`atomic usage` prints a readable summary; `atomic usage --json` prints one JSON object. Both check every configured account (including pay-per-token API keys) without starting a chat. Add `--offline` to read the latest saved figures without contacting any provider. If no accounts are configured, the JSON output is `{"accounts":[]}`. An [RPC client](https://docs.bastani.ai/rpc/protocol.md#get_usage) returns the same report from an open session.

```json theme={null}
{
  "accounts": [
    {
      "provider": "openai",
      "name": "OpenAI",
      "current": true,
      "status": "ready",
      "availability": "available",
      "source": "stored",
      "observedAt": "2026-11-29T16:30:00.000Z",
      "windows": [],
      "limitReached": {
        "code": "subscription_sharing_usage_limit_exceeded",
        "actionLabel": "Manage usage",
        "actionUrl": "https://chatgpt.com/settings/usage"
      },
      "usageUrl": "https://chatgpt.com/settings/usage"
    },
    {
      "provider": "openai-codex",
      "name": "OpenAI Codex",
      "current": false,
      "status": "ready",
      "availability": "available",
      "source": "stored",
      "observedAt": "2026-11-28T16:30:00.000Z",
      "windows": [
        { "label": "Weekly", "usedPercent": 87, "durationSeconds": 604800, "resetsAt": "2026-11-30T17:16:00.000Z" }
      ]
    }
  ]
}
```

### JSON, RPC, and SDK report fields

The CLI (`atomic usage --json`), RPC (`get_usage`), SDK (`getSubscriptionUsage()`), and extension (`ctx.getSubscriptionUsage()`) reports all use the exact same account fields. Reports never include credentials or raw provider error bodies.

| Field | Meaning |
| - | - |
| `provider`, `name`, `current` | The account ID, display name, and whether it is the active provider. |
| `availability` | `"available"` when Atomic has usage figures, a remembered limit-reached state, or a configured pay-per-token API key; `"unavailable"` otherwise. |
| `status` | How the check finished: `"ready"`, `"unavailable"`, or `"failed"`. A single report can include accounts in all three states. |
| `observedAt` | When Atomic last recorded figures or a confirmed status change for this account, in UTC. Omitted when Atomic has never recorded an observation for the account. |
| `source` | Where the data came from: `"live"` (fresh provider check), `"recent_response"` (fallback from a recent model response), `"last_request"` (observed on the latest OpenAI response), or `"stored"` (saved in local/shared storage). |
| `windows` | The usage windows reported for the account (`label`, `usedPercent`, `durationSeconds`, `resetsAt`). Unknown lengths or reset times are `null`. |
| `limitReached` | Present when a ChatGPT plan-sharing account hit a usage limit (`code`, plus `actionLabel` and `actionUrl` when self-service management is available at `https://chatgpt.com/settings/usage`). Cleared automatically after a subsequent request succeeds. |
| `usageUrl` | Link to manage usage in ChatGPT (`https://chatgpt.com/settings/usage`) for personal ChatGPT plan-sharing accounts. Omitted for workspace-admin-only limits. |
| `plan`, `credits`, `resetCredits`, `extraUsage`, `creditCap`, `unlimitedWindows`, `rateLimits` | Extra details reported by specific providers. `rateLimits` are per-request or per-minute capacity headers, not subscription windows. |
| `reason`, `message` | Machine-readable reason code and human-readable explanation when an account is unavailable, failed, or showing a fallback. |

## Check from the SDK

```typescript theme={null}
import { getSubscriptionUsage } from "@bastani/atomic";

const { accounts } = await getSubscriptionUsage();
for (const account of accounts) {
  if (account.status === "ready" && account.limitReached) {
    const action = account.limitReached.actionUrl
      ? ` (${account.limitReached.actionLabel}: ${account.limitReached.actionUrl})`
      : "";
    console.log(`${account.name}: usage limit reached${action}`);
    continue;
  }
  if (account.status === "ready") {
    for (const window of account.windows) {
      console.log(`${account.name}: ${window.label} — ${window.usedPercent}% used`);
    }
  }
}
```

Pass `accounts: ["github-copilot", "openai"]` to check only specific providers, `maxAgeMs: 0` to bypass the 60-second cache, or `signal` to cancel. Extensions can call `ctx.getSubscriptionUsage()` for the accounts in their session.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.