What are tokens and usage limits? Four coding agents

By

A token is the unit a model reads and writes. A usage limit is how much of that work a plan includes. How Claude Code, Codex, Cursor and Grok count it.

A token is a small unit of text a model reads and writes. Your prompt, the files the agent attached, the chat so far, tool results, and the reply all use tokens. A usage limit is how much of that work your plan includes before the tool pauses you or starts billing extra.

In English, one token is roughly three quarters of a word. That ratio is a rule of thumb from the tokens lesson in the free AI fundamentals course. Don’t bill from it. A coding agent spends far more tokens than the sentence you typed, because the next turn sends the history again. The context window is how much fits in one request. Usage is the sum across requests.

How tokens and usage limits work

You pay, or you draw down a plan, for input and for output. Input is everything the agent sent. Output is what the model wrote back, including a long thinking trace when reasoning effort is high. A short follow-up can still be expensive, because the earlier files and test logs ride along.

Plans hide that sum behind an allowance. When the allowance is gone, the product either waits for a reset or lets you buy more. An API key usually has no allowance. It bills the tokens.

How a coding agent spends tokensThe agent sends the prompt with files, history and tool results. The model reply adds output tokens. The plan adds them up and either allows another turn or pauses and offers extra usage.YesNoPrompt, files,history, toolresultsModel replyPlan adds input andoutput tokensAllowance left?Next turn can runPause, or pay forextra usage

Tokens and usage limits in each tool

The four products all count tokens. They don’t share one allowance screen, and a subscription is not the same bill as an API key.

Claude Code Codex Cursor Grok Build
See this session /usage (aliases /cost, /stats) /status for context left, /usage for account activity Editor settings, and Usage on grok.com /usage
What the plan limits Included usage on a subscription, tokens on an API key A plan allowance that depends on the model and the task A weekly pool for Cursor models Credit usage on the shared X Subscription pool
After the limit Usage credits, if your sign-in allows them Credits on eligible plans, or an API key at API rates Top-ups, or wait for the weekly reset Additional usage from top-ups

Claude Code

/usage shows session cost, plan usage limits, and activity stats. On a Pro, Max, Ultra, Team, or Enterprise plan it also breaks down what counts against the plan. /cost and /stats are aliases. /stats opens on the Stats tab.

The Session block is the API token view. Claude Code computes the dollar figure on your machine from token counts at list price, unless an admin set a modelPricing table for contracted rates. The figure is an estimate. For the bill, use the Usage page in the Claude Console. Pro, Max, and Ultra subscribers already have usage in the subscription, so that session dollar figure is not what they pay. They see plan usage bars on the same screen.

/usage-credits is how you add usage credits after a limit, when you signed in with a claude.ai subscription through /login. It is not available on an API key. Team and Enterprise members without billing access send a request to an admin instead of opening the billing page.

See Manage costs effectively and the commands reference.

OpenAI Codex

ChatGPT’s pricing page describes a token as a small unit of information ChatGPT reads and writes. Prompt, files, chat history, tool results, and the response all use them. Credits are a separate unit. On credit-based plans they pay for eligible usage after the included limits.

How many messages you can send depends on the model, the size and complexity of the task, and whether the task runs locally or in the cloud. Prompt length alone is a poor estimate. The pricing page shows local-message estimates per five-hour period for Plus and Standard Business, and it says those estimates are not fixed message limits. Pro plans currently have no five-hour limit. Cloud tasks may use more of the allowance than local messages. Local messages and cloud chats share the plan allowance, and weekly limits may also apply.

During a CLI session, /status shows the remaining limits, along with the model, the approval policy, and how much context is left. /usage views account token usage, including daily, weekly, or cumulative activity, or uses a rate-limit reset when one is available. The usage dashboard is the place to check the current limits and reset times.

See Codex pricing and the slash commands.

Cursor

In November 2026, each paid plan includes one pool of usage for Cursor’s own models: Grok 4.7, Grok 4.6, Grok 4.5, and Composer 2.5. The pool is shared across Agent in the editor, the CLI, Cloud Agents, Grok Bot, and the Grok apps. It refreshes weekly. Different models draw from it at different rates. Remaining usage and the next reset show in editor settings and under Usage at grok.com/dashboard.

The per-million-token rates on the models page apply when you buy usage past that pool. Inside the pool, you are spending the allowance, not those dollar rates. Third-party models such as Claude, GPT, and Gemini are not in the pool. On Premium and above they bill at API list price from the first request, paid from prepaid credit. Plus and Free don’t include them.

On Teams and Enterprise, eligible third-party requests also add a Cursor Token Rate of $0.25 per million tokens, on top of the API price, for input, output, and cached tokens. Individual plans don’t pay that rate. It does not apply to Grok, Composer, or Cost mode requests.

Grok 4.7 long context, above 256k input tokens, is billed at 2x standard rates, up to 500k. That multiplier is on the same models page.

See Cursor models and pricing.

Grok Build

/usage views credit usage or opens billing. The X Subscription usage page describes one weekly pool per paid seat for eligible first-party usage, shared across eligible Grok and Cursor surfaces rather than split into separate product quotas. Third-party model usage in Cursor is Additional Usage, and so is first-party usage past the weekly pool. Top-ups buy credits for both. After the included usage is gone, further first-party usage is paid from those credits.

The usage page doesn’t print a token price for a Grok Build turn. It tells you to read the live usage view for how much is left and when it resets. The Cursor models page is where the Grok token rates for extra usage are listed, and the Plus plan line there names Grok Build as included.

See Grok Build commands and usage limits.

Details checked against each vendor’s documentation in November 2026.

A real example

You finished a long Claude Code session and the next edit feels slow to start. Run /usage before you blame the model.

Read the plan usage bars if you are on a subscription. Read the Session block if you are on an API key. A large session cost with a warm cache still means the history is big. /clear drops that history. The context window entry covers /context and /compact, which are the window, not the plan allowance.

On Codex, run /status in the same kind of moment. If the remaining limit is the problem, the pricing page points you at the usage dashboard for the reset time. On Grok Build, run /usage.

If you want a count of one prompt before you send it, paste it into the token counter. That tool counts the text you paste. It does not see the files and tool results an agent will attach.

When to watch tokens

Watch them when a session has been open for a long task, when you raised reasoning effort, or when you are about to leave an agent on a goal. A goal can spend tokens across many turns while you are away.

Skip the accounting when you are on a subscription, the task is short, and /usage or /status still shows plenty of allowance. The prompt caching post is the one to read when the same project rules are being processed over and over. Local models versus an API is the comparison when you are deciding whether to pay per token at all. A coding agent without another subscription covers signing in with a plan you already have.

Pitfalls

The dollar line in Claude Code’s Session block is computed locally from list price. Subscribers don’t pay that line. API users still need the Console for the real invoice, and a modelPricing table changes the line to contracted rates.

Codex can spend very different amounts on two tasks that look the same length. The pricing page names model, context, reasoning, tool use, retrieval, and caching as the reasons. A five-hour estimate on that page is not a promise of N messages.

Cursor Plus will not run a third-party model out of the weekly pool. Those models aren’t on the plan. Premium bills them from prepaid credit starting at the first request, even while Grok allowance remains. On Teams and Enterprise the Cursor Token Rate can land on top of that API price. Grok 4.7 also doubles the rate once the input passes 256k tokens.

A full context window and an empty plan feel alike in the chat. One is this request. The other is the allowance across requests. /usage, /status, and the dashboard tell you which one you hit.

  • Context window: The context window is everything a coding agent can see at once. How to check it, free it and keep it small in Claude Code, Codex, Cursor and Grok Build.
  • Reasoning effort: Reasoning effort sets how long a model thinks before it answers. The levels in Claude Code and Codex, what Cursor's plans fix, and how Grok sets effort.
  • Goal mode: Goal mode keeps a coding agent working until a condition holds. How /goal works in Claude Code, Codex, the Cursor CLI and Grok Build.

All AI glossary entries →

Want me to talk about your product? You can sponsor this site.