Integration · Agent
Use a custom model in Grok Build
Grok Build is xAI’s coding agent and reads model definitions from ~/.grok/config.toml. AutoJev adds a model entry for each model or route you select, all pointing at the local gateway, and sets your default.
- One [model."<id>"] entry per selection
- Sets [models] default
- Chat Completions in, any protocol out
- Your own models kept on restore
Agents
CodexResponses
~/.codex/config.toml
Claude CodeMessages
~/.claude/settings.json
Gemini CLIGemini
~/.gemini/settings.json
OpenCodeChat
~/.config/opencode/opencode.json
How AutoJev connects Grok Build
Grok Build defines each model as a [model.<name>] table with its own base URL, key and API backend. When you connect, AutoJev writes one such table per selected model or route — each using base_url http://127.0.0.1:9527/v1, the placeholder key autojev-local-grok, and api_backend chat_completions — and points [models] default at your chosen default.
Requests then flow to AutoJev as Chat Completions. AutoJev resolves the model or route, calls the upstream provider with your key, converts to Responses or Anthropic Messages if needed, and fails over to another candidate when a route allows it.
What AutoJev configures
What Grok Build gains from the gateway
One place for keys
Provider keys live in AutoJev on your machine. Grok Build only holds a placeholder key, and requests go directly to your providers with no markup.
Failover before output
On connection errors or HTTP 401/402/403/408/429/5xx before output starts, a route retries another candidate (up to 4 attempts by default) and respects Retry-After.
Per-agent logs and cost
Every request is labeled grok, with model, route, input/output/cache tokens, latency and estimated cost. Prompts and responses are not stored.
Routing without edits
Connect a route once. Switch its strategy between load balancing and intelligent selection in AutoJev without touching Grok Build’s config again.
Set up Grok Build with AutoJev
- 1
Install AutoJev
Download the desktop app and open it; the gateway starts on port 9527.
- 2
Add providers and models
Add OpenAI, DeepSeek, OpenRouter, Ollama or any OpenAI-compatible or Anthropic-compatible endpoint with your own key, then add models.
- 3
Optional: create a route
A route like autojev/quality or autojev/cheap lets AutoJev pick per request.
- 4
Connect Grok Build
On Agents, AutoJev detects the grok executable. Select models and routes, choose the default and click Connect.
- 5
Start Grok Build
Start a new session; requests appear in AutoJev Logs under grok.
bash
The config AutoJev writes
Example with the route autojev/fast as default. Each extra selection adds another [model."<id>"] table with the same base URL and key.
Switching models and routes
Every selection is a model entry, so you can switch between them in Grok Build. To change the list or the default, update the Agents page and reconnect, or use “Batch update configurations”. On each update, AutoJev removes only the entries it wrote (same placeholder key and gateway URL) and writes the new set. If an existing model of yours uses the same ID, AutoJev stops instead of overwriting it.
Restoring config.toml
AutoJev validates the TOML before writing and keeps a backup. Disconnect, “Stop and restore configurations” or quitting from the tray restores your original default and removes AutoJev’s entries, while keeping non-conflicting edits you made later.
Chat Completions to any upstream
AutoJev converts among Chat Completions, Responses and Anthropic Messages, including streaming and function tools.
One endpoint, three protocols
127.0.0.1:9527/v1
Chat Completions
/v1/chat/completions
Responses
/v1/responses
Messages
/v1/messages
Frequently asked questions
Can Grok Build use non-xAI models?
Yes, through AutoJev. Every model you add in AutoJev can be selected for Grok Build and appears as its own model entry.
Which API backend does AutoJev set?
chat_completions. AutoJev converts the request if the upstream model uses Responses or Anthropic Messages.
Will AutoJev change my existing Grok models?
No. It only removes and rewrites entries that use its placeholder key and gateway URL, and it refuses to overwrite a model with a conflicting ID.
Does AutoJev respect GROK_HOME?
Yes. If GROK_HOME is set, AutoJev edits config.toml in that directory.
Can I use Grok models through AutoJev too?
If xAI’s API is reachable as an OpenAI-compatible endpoint, add it as an OpenAI-compatible provider with your key. AutoJev has no dedicated xAI preset.
Keep exploring
Updated 2026-10-14
Give every agent the right model.
Install AutoJev, add the providers you already pay for, and connect your agents in one click. Everything stays on your machine.
Free & open source · macOS · Windows · Linux