- Grok Build, xAI’s official coding agent;
- Community Grok CLI, an open-source project that is not affiliated with xAI.
What is the difference between Grok CLI and Grok Build?
This guide only covers text and code model requests through BetterToken. It does not cover xAI-specific APIs such as X Search, speech transcription, image generation, or video generation.
Use Community Grok CLI with BetterToken
The following commands apply to macOS, Linux, and WSL. Native Windows installation and configuration have not been verified for the community client.Install
@vibe-kit/grok-cli package is no longer the installation path recommended by the project’s current README.
Configure BetterToken
YOUR_MODEL_ID with the complete Model ID from the model plaza. Use your own BetterToken API Key: register and get one.
Verify the connection
Community Grok CLI has been verified to return a model response through BetterToken. This result only covers the basic text and code model requests configured on this page, not tool calls or xAI-specific features.
Switch models
ChangeGROK_MODEL to another complete Model ID, restart Grok CLI, and repeat the short request.
Official Grok Build
Grok Build is xAI’s official terminal coding agent. It supports an interactive TUI, headless operation, and ACP.Install
- macOS / Linux / WSL
- Windows PowerShell
Use an xAI account or API key
Grok Build opens a browser for authentication on first launch. xAI documentsXAI_API_KEY for environments without a browser:
Optional: configure BetterToken in Grok Build
Grok Build supports OpenAI-compatible custom models with a Base URL, Model ID, authentication environment variable, and request protocol.BETTERTOKEN_API_KEY is an example variable name, not a fixed Grok Build requirement. Grok Build reads whichever environment variable env_key names.
Grok Build has been verified to return a model response with a BetterToken API Key, Base URL, and Model ID. This result only covers the text and code model requests described here; it does not verify tool calls or xAI-specific APIs.
Avoid a grok command conflict
- macOS / Linux / WSL
- Windows PowerShell
type -a grok and Get-Command grok -All list multiple commands with the same name. Remove the unused client or adjust PATH if both are installed.
Common errors
Available models and feature limits
Copy a complete Model ID that supports OpenAI-compatible calls from the model plaza. A configurable Base URL alone does not prove that a model family’s requests, tool calls, or context format are compatible.This page only covers text and code model requests. BetterToken does not provide X Search, speech transcription, image generation, video generation, or other xAI-specific APIs through this setup.

