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

Grok Build shows plan usage with /usage and grok usage, and a per-process cost in the status line. What each shows, what is missing, and how to keep it visible.

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.


**ACP on Grok Build.** One command adds a hook that sees native and MCP tool calls in every mode, always-approve included. Each call is recorded, and by default a force-push, destructive SQL, `curl | sh` or a recursive delete outside the project is held until you approve it.

```bash
# macOS, Linux, WSL
curl -fsSL https://agenticcontrolplane.com/install.sh | bash

# Windows (PowerShell)
irm https://agenticcontrolplane.com/install.ps1 | iex
```

In default and plan modes the hold shows as Grok's own prompt. In auto, bypass and headless modes you approve on the console or from the email. Needs a free workspace: `--local` skips Grok Build. Connected, the hook sends ACP each call's tool name and arguments, and up to 200 KB of its output. Free up to 5 agents.

[What the installer writes](https://agenticcontrolplane.com/install-explained) · [Grok Build guide](https://agenticcontrolplane.com/integrations/grok-build) · [What ACP sees on each agent](https://agenticcontrolplane.com/coverage)


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](https://docs.x.ai/build/enterprise) 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](https://docs.x.ai/build/modes-and-commands) 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](https://docs.x.ai/build/modes-and-commands)).

**`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."

```text
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](https://docs.x.ai/build/features/status-line), 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`:

```toml
# ~/.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:

```toml
[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](/controls/grok-build), 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](/integrations/grok-build) has the details, and [Turn on Cost X-Ray](/cost-tracking) 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 <session-id> 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 <session-id> 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

- [Grok Build modes and commands](https://docs.x.ai/build/modes-and-commands): `/usage`, `/context`, `/session-info` and permission modes
- [Status line](https://docs.x.ai/build/features/status-line): built-in items, command mode, refresh
- [Authentication](https://docs.x.ai/build/enterprise): sign-in methods and API keys
- [Grok Build controls](/controls/grok-build): hooks, permission modes and deny rules
- [Grok Build install guide](/integrations/grok-build): the hook and the cost X-Ray
- [Turn on Cost X-Ray](/cost-tracking): the proxy path across harnesses
- [Antigravity cost tracking](/blog/antigravity-cost-tracking): the same question for Google's CLI
