Grok Build

Install

Run the appropriate command for your current terminal:

irm https://x.ai/cli/install.ps1 | iex
macOS/Linux:
curl -fsSL https://x.ai/cli/install.sh | bash

After installation, check the version:

grok --version
The Grok Build version

Recommended: connect with CC Switch

  1. Open CC Switch, switch to the Grok page, then click + in the upper-right corner.
Open CC Switch, switch to the Grok page, then click + in the upper-right corner.
  1. Choose Custom Config.
Choose Custom Config.
  1. Enter the API Key you just created and set the request URL to https://api.himodels.ai/v1.
Enter the API Key you just created and set the request URL to https://api.himodels.ai/v1.
  1. Click the fetch button next to the default model and select the model you want to use. Keep the upstream format as Responses (native), then click Add.
Click the fetch button next to the default model and select the model you want to use. Keep the upstream format as Responses (native), then click Add.
  1. After adding the provider, return to the CC Switch home page and click Enable on the HiModels provider.
After adding the provider, return to the CC Switch home page and click Enable on the HiModels provider.

Verify

grok
Grok Build replying normally
Grok Build replying normally

Once you get a normal reply, open HiModels → Model Management and check the request time, model and group to confirm the call went through HiModels. For 401, 403 or 429 errors, see the FAQ.