Skip to content
Agentic Control Plane

Grok Build cost tracking: /usage, grok usage, status line cost

David Crowe David Crowe · · Updated · 9 min read
grok-build cost usage reference
Share X HN LinkedIn

Grok Build keeps usage in three places: /usage inside a session, grok usage from a shell, and an optional cost item in the status line. The first two are about your plan and your saved sessions. The status line is the only live number for what the current process has cost.

Checked on 2026-11-25 against grok 1.0.77 (its own --help output) and the Grok Build docs at docs.x.ai/build. Grok Build ships updates often, so check grok --version against that.

How Grok Build is paid for

The docs describe signing in two ways that matter for billing: an account, or an API key.

Sign-in Command
Browser (personal machine) grok
Device code (SSH or remote machine) grok login --device-auth
API key (CI and scripts) export XAI_API_KEY="xai-..."

The enterprise page lists four session authentication methods (browser, device code, an external auth provider command, and an API key) and says that with several credentials present, Grok picks per model in this order: model.api_key, model.env_key, the active session token, then XAI_API_KEY.

The docs I read do not publish plan prices, usage limits or per-token API rates for Grok Build, and they do not say how XAI_API_KEY usage is billed. Get those from xAI’s own pricing and billing pages, and treat any number quoted without that source with suspicion.

What Grok Build shows

/usage in a session. The modes and commands page describes it as “View credit usage or manage billing”. It is about your account’s credits, not about a single task.

/context shows context usage, and /session-info shows session info (same page).

grok usage from a shell. The CLI help for 1.0.77 reads: “Print your plan’s usage limit, or a session’s persisted token and cost usage.”

grok usage [OPTIONS] [SESSION_ID] [TURN]

With no session ID it prints your plan’s usage limit, and the help notes this needs Grok’s background service. --json prints that limit as JSON. With a session ID it prints the persisted token and cost usage for that session: totals plus every recorded turn, or one turn if you pass a turn number. Find a session ID with grok sessions list.

The status line is off by default. Per the status line docs, you add a [ui.status_line] section to ~/.grok/config.toml and restart Grok. The built-in items are cwd, model, context, cost, turn-timer and session-name, and the default is cwd, model and context. Add cost:

# ~/.grok/config.toml
[ui.status_line]
type = "builtin"
items = ["cwd", "model", "context", "cost"]

The docs say of cost: “Cost for this Grok process. Hidden below $0.005. A resumed session counts from the resume.” So the number is per process, not per task and not per day. grok inspect lists problems in the section, and a cloned repository cannot set a status line.

The command-mode status line

Set type = "command" and Grok runs your script, passes JSON on stdin and shows what it prints:

[ui.status_line]
type = "command"
command = "~/.grok/statusline.sh"
refresh_interval = 300

refresh_interval is in seconds. Without it, the docs say an idle session does not re-run the script. The documented common fields are model.display_name, context_window.used_percentage, workspace.branch and cwd, and Grok omits a field it cannot determine. The docs do not document a cost field in that JSON, so use the built-in cost item for dollars and a script for everything else.

Where usage lives

  • Plan usage: on xAI’s side. /usage and grok usage fetch it.
  • Session token and cost data: persisted per session. grok usage <session-id> reads it back, and grok export <session-id> writes the transcript as Markdown.
  • Disk use: grok du shows what ~/.grok uses on disk.
  • Settings: ~/.grok/config.toml.

What is missing

  • A published price list in the docs. You cannot turn a plan’s usage limit into dollars from the pages I read.
  • A cost field for scripts. Cost is a built-in status line item, not documented in the command-mode JSON.
  • Cost per tool call. grok usage goes down to the turn.
  • A running total across sessions. The status line cost restarts with each process, and grok usage reports one session at a time.
  • A team view. Nothing in the CLI help or docs described here reports spend per developer.

Keeping a running cost visible

  1. Turn on the cost status line item, as above.
  2. When a session ends, run grok sessions list and then grok usage <session-id> for the persisted figures.
  3. Check /usage before a long run and after it, to see how much of your plan the run used.

What these numbers leave out

All of this is model usage. None of it says what the agent did: which commands ran, which files changed, what was denied. Grok Build runs PreToolUse hooks in every mode, including always-approve, and ACP uses them to record each native and MCP tool call and check it against your rules. That hook never sees the model call, so it does not price anything. To get priced spend, the cache hit rate and a loop-versus-leaf breakdown, the installer adds a [model.acp] block to ~/.grok/config.toml and a grok-acp launcher that routes model calls through the ACP proxy for that launch. The install guide has the details, and Turn on Cost X-Ray lists every supported harness.

Frequently asked questions

How do I check usage in Grok Build?

In a session, run /usage. The docs describe it as the command to view credit usage or manage billing. From a shell, grok usage prints your plan’s usage limit (add --json for JSON), and grok usage prints a saved session's token and cost usage, with every recorded turn unless you name one.

Does Grok Build show cost per session?

Yes, in two places. The optional status line has a cost item that shows the cost for the current Grok process, hidden below $0.005, and a resumed session counts from the resume. For a finished session, grok usage reads the persisted token and cost figures.

Does the Grok Build status line script get a cost field?

The status line docs list model.display_name, context_window.used_percentage, workspace.branch and cwd as common fields, and do not document a cost field in the command-mode JSON. Cost is documented only as a built-in status line item.

Can I see per-tool-call cost in Grok Build?

Not from anything the docs or the CLI help describe. grok usage can break a session down by turn, not by tool call. The ACP hook records each tool call, but it never sees the model call, so it does not price one. To price model calls, route them through the ACP proxy with grok-acp.

Where to read more

Running Grok Build? One command adds a hook. Each tool call it sees is recorded, and a force-push, destructive SQL or curl | sh is blocked until you approve it on the console or from the email.

macOS · Linux · WSL
curl -fsSL https://agenticcontrolplane.com/install.sh | bash
Windows · PowerShell
irm https://agenticcontrolplane.com/install.ps1 | iex

What the installer writes  ·  Grok Build guide  ·  free up to 5 agents

Share X HN LinkedIn
Get the next data drop
What agents actually cost, new tool-surface captures, and the occasional incident post-mortem — sent when we publish something worth your inbox, not on a schedule. Unsubscribe anytime.
Share: Twitter LinkedIn
Related posts

← back to blog