1.
Discover models with GET https://api.kie.ai/xai/v1/models, not from memory or training data. This endpoint gives the list Grok Build can run on this prefix. The general taskType=Chat catalog is a different, wider list that includes models this endpoint does not serve.
2.
Authenticate with Authorization: Bearer. Every KIE endpoint, including the model listing, carries the API key in this one header. A header literally named apikey is rejected with 401.
3.
Set api_backend = "responses". Grok Build's default backend is chat_completions, which sends to /v1/chat/completions. KIE serves these models on /xai/v1/responses.
4.
Fill the model field with an id from the listing. That is the name sent to KIE. It is neither the table name [model.<name>] nor Grok Build's own spelling (for example grok-4.6). The listing uses a different set of ids (for example grok-4-6). Copy the id from the list; with the built-in name KIE rejects the request even if base_url is right.
5.
Put the table in user-level config. A project-level .grok/config.toml only contributes MCP, plugin and permission keys. A [model.*] table there is not inference configuration.
1.
A header named apikey. KIE returns 401. Put the key in Authorization: Bearer.
2.
The full request URL in base_url. With api_backend = "responses", Grok Build appends /responses itself, so a base_url ending in /responses becomes /responses/responses.
3.
No api_backend. The default is chat_completions, which sends to /v1/chat/completions, not /xai/v1/responses.
4.
Grok's own model name in model. KIE reads the model field of [model.<name>], which must be an id from the listing. A built-in spelling such as grok-4.6 is not that id.
5.
[model.*] in the project-level .grok/config.toml. That file does not carry inference configuration. Use ~/.grok/config.toml.
6.
The key itself in env_key. It takes the name of an environment variable. The key lives in that variable, not in the config file.
7.
setx does not affect the current window. It applies to windows opened afterwards. Set $env: as well to use it right away.
8.
PowerShell curl. It is an alias for Invoke-WebRequest and does not accept these arguments. Use curl.exe.