Skip to main content

Grok Build setup (Grok 4.5)

How to run Grok Build CLI/TUI against the gateway with grok-4.5.
Grok 4.5 context: 500k max, but quality drops past ~200k.
The model can accept about 500k tokens, but reasoning quality degrades clearly after ~200k (worse answers, missed edits, flaky tool use).
For coding agents, set client context_window to 200000 so auto-compaction runs before that cliff. Do not keep multi-hour sessions just to “use the full 500k”.
Turn off Grok Build data training / “improve the model” data sharing.
Using a relay does not skip client privacy settings. Before configuring models, run /privacy and confirm training / data sharing is off. See Disable data training.
If chat works but web_search returns 402 Payment Required / spending-limit, search is often using a separate model without backend search. Point both chat and web_search models at gateway grok-4.5 and set supports_backend_search = true.

0. Disable data training (required)

Using the relay does not mean you can skip client privacy settings.
  1. Start Grok Build (TUI).
  2. Run:
  1. Review privacy / data-retention status.
  2. Turn off options related to training / improve-the-model / data sharing for training.
  3. Run /privacy again to confirm.
You can also open settings:
Find Privacy / Data controls (or similar) and disable “Improve the model” style toggles.

Optional: disable client telemetry

In ~/.grok/config.toml:
This is separate from data-training toggles; both are worth reviewing.
/privacy controls privacy / retention / training participation; [features].telemetry controls anonymous usage telemetry.
If you still use an xAI / X account, also disable Grok training options under X → Settings → Privacy and safety → Grok.

1. Prepare an API key

  1. Create a key in the console
  2. Prefer an environment variable:

2. Edit ~/.grok/config.toml

Windows:
macOS / Linux:

Option B: override built-in grok-4.5

When overriding a built-in model, only set fields you change. Still set supports_backend_search = true for web_search.

Option C: shared endpoint base

With models_base_url, Grok can list models via API key auth and usually does not need grok login.

3. Launch and switch models

4. Verify

web_search check

Ask in Grok Build:
  • Success: search summaries returned
  • 402 / spending-limit: check web_search model section and supports_backend_search

Field reference

Context window (important)

Practice:
  1. Set context_window = 200000 — do not default to 500000 just because the spec allows it.
  2. Start a new session / compact mid-task instead of stacking endless history.
  3. Avoid dumping entire monorepos; scope files to the task.
  4. Only raise to 500000 temporarily when you truly need the hard window and accept lower quality.

Optional: Chat Completions backend

Fine for basic chat; prefer responses + supports_backend_search for web_search.

FAQ

Model list missing arona-grok45

  • Validate TOML syntax
  • Restart terminal / Grok Build
  • Run grok models

401 Unauthorized

  • Env var visible in the current shell
  • Full key copied
  • Key not written to the wrong field

Chat works, web_search fails

  1. [models].web_search points at your relay model
  2. That section’s base_url is the gateway
  3. supports_backend_search = true
  4. Both chat and search use a working grok-4.5

Context compresses too soon / quality drops on long sessions

  • Prefer quality: set context_window to 200000 so the client compacts near ~200k instead of waiting for 500k.
  • Grok 4.5 hard max is ~500k, but quality drops past ~200k. Larger context_window is not “smarter”.
  • If you already set 500000 and the session is huge: new session, drop unrelated history, shrink attached files.
  • Only use 500000 temporarily for rare ultra-long dumps, then set it back to 200000.

Confirm data training is off

  1. /privacy → training / retention off
  2. /settings Privacy / Data controls
  3. Optional [features] telemetry = false
  4. Account-side Grok training toggles on X if logged in
Do not paste secrets while training options are still on.