Skip to main content
Configure Grok Build to call the Modellix LLM gateway. Grok Build is xAI’s coding agent (interactive TUI, headless CLI, or ACP). It has no built-in Modellix provider, so add custom models in ~/.grok/config.toml that point at Chat Completions on POST /v1/chat/completions.
This page covers LLM text only (https://llm.modellix.ai).Modellix model IDs are provider/name (for example openai/gpt-5.5). Put that full string in each custom model’s model field so Grok Build sends it unchanged in the request body. See Models & Pricing.

Set Up Grok Build

1

Install Grok Build

2

Get a Modellix API Key

Create a key in the Modellix console and export it. Grok Build reads the key from the environment variable named in env_key:
Add the same line to your shell profile (for example ~/.zshrc), then run source ~/.zshrc.
Use a Modellix API key, not an xAI platform key. A built-in Grok catalog model with XAI_API_KEY still talks to https://api.x.ai/v1, not Modellix.
3

Add Custom Models

Edit the user config at ~/.grok/config.toml (Windows: %USERPROFILE%\.grok\config.toml). If GROK_HOME is set, the file is $GROK_HOME/config.toml instead.Merge the [model."..."] tables into an existing file. Do not put custom models in a project .grok/config.toml—that file only accepts MCP servers, plugins, and permission rules.
Add or remove [model."..."] tables as needed. Quote the table key when the local ID contains / or ..Setting models.default to a Modellix ID avoids falling back to a built-in xAI catalog model that requires XAI_API_KEY. Full catalog: Models & Pricing.
You do not need a separate Anthropic base URL. Register anthropic/... and google/... IDs on the same Modellix base_url; traffic goes through OpenAI-compatible Chat Completions. Native Anthropic Messages (api_backend = "messages" without /v1) is for the Anthropic SDK and Claude Code.
If you prefer Responses instead of Chat Completions, set api_backend = "responses" and keep base_url = "https://llm.modellix.ai/v1". See Responses. Most setups should keep chat_completions.
4

Select a Modellix Model

Confirm Grok Build loaded the user config, then start a session from your project directory:
In the TUI, switch models with /model <id> (for example /model openai/gpt-5.5). Headless:
You can also set GROK_DEFAULT_MODEL for the current session (same idea as -m).

Troubleshooting