~/.grok/config.toml, so any model in the AI Gateway catalog can be reached from a single config entry without changing tooling.
Prerequisites
- Active Orq.ai account
- Orq.ai API key
Install Grok Build
- macOS / Linux
- Windows
grok and agent in ~/.grok/bin/ and updates the user PATH.
Setup
1
Edit ~/.grok/config.toml
Configure models with a Replace
[models] section and one [model.<key>] block per model. The example below uses Claude Sonnet 4.6 routed through Orq.ai:anthropic/claude-sonnet-4-6 with any model identifier from the AI Gateway catalog. To register additional models, add more [model.<key>] blocks and switch between them with -m <key>.2
Export the API key
<orq-api-key> with the key from Organization > API Keys. The env_key field in config.toml tells Grok Build which environment variable to read.3
Launch Grok Build
Start an interactive session with the Orq-routed model:For a headless one-shot completion:
Configuration Reference
config.toml fields
Adding more catalog models
Add one[model.<key>] block per model and use -m <key> to select at runtime:
Troubleshooting
Bare `grok` resolves to a different CLI
Bare `grok` resolves to a different CLI
If the npm package
@vibe-kit/grok-cli is installed, the bare grok command may resolve to it instead of the xAI binary. Use the absolute path ~/.grok/bin/grok or remove the npm package to restore the correct resolution.No Traces appearing in Orq.ai
No Traces appearing in Orq.ai
Confirm
base_url is set to https://api.orq.ai/v3/router and env_key points to a valid Orq.ai API key (not an xAI or OpenAI key). Requests to the wrong endpoint will not appear in Orq.ai Traces.Model not found error
Model not found error
Verify the
model field uses the exact AI Gateway identifier (e.g. anthropic/claude-sonnet-4-6). Check the available models in Workspace Settings → Models.Verification
Launch Grok Build withgrok -m orq-claude and send a prompt. The response appears in the session and the trace appears in Orq.ai Traces with the model identifier anthropic/claude-sonnet-4-6 (or whichever model was selected).