Setup guide - Documented by Goose
Use Grok in Goose
goose ships a built-in xAI provider configured with XAI_API_KEY (and optional XAI_HOST). Select it with goose configure or the Desktop Models tab, or set GOOSE_PROVIDER/GOOSE_MODEL.
Last verified 4 steps4 official sources
Steps
- Step 1.
In your terminal, run goose configure, select Configure Providers, choose xAI from the provider list, and enter your XAI_API_KEY when prompted. Press Enter to keep the default XAI_HOST.
Terminalgoose configure - Step 2.
Choose the model you want to use from the list. goose configure does not accept custom model names; for a model not in the list, use goose Desktop (Use custom model) or set GOOSE_MODEL in config.yaml.
- Step 3.
Alternatively set the provider and model through environment variables (documented variables, combined with goose's xai provider id and a current xAI model id):
Terminalexport GOOSE_PROVIDER=xai export GOOSE_MODEL=grok-4.7 export XAI_API_KEY=your_api_key - Step 4.
goose Desktop: Settings > Models > Configure providers, click xAI, add your API key, Submit; then Switch models to pick a Grok model.
Caveats
- goose's provider table still describes xAI as 'grok-3, grok-3-mini, and grok-3-fast with 131,072 token context window'. That text is stale: goose's source (crates/goose/src/providers/xai.rs) sets XAI_API_HOST to https://api.x.ai/v1 and the default model to grok-4.5, and grok-3 was retired by xAI on May 15, 2026.
- The env-var example combines goose's documented GOOSE_PROVIDER/GOOSE_MODEL variables with the provider id 'xai' from goose source and grok-4.7 from xAI docs.
- goose docs are maintained in the aaif-goose/goose repo (block/goose serves the same file).
More setup guides
Same tool, other providers
Related reading
- GPT-6 Sol vs Claude Opus 5.5 vs Grok 4.7: The September 2026 Price WarGPT-6 Sol vs Claude Opus 5.5 vs Grok 4.7 pricing: verified per-token rates, cost-per-task math and a decision guide for the September 2026 price war.
- Grok Bot's Core Primitive: Every Bot Gets a ComputerGrok Bot gives every Bot a persistent cloud computer with a browser and terminal. Why that one primitive explains routines, Bot teams, and always-on work.
- Grok Bot's Meta Controls: Oversight as a Product PrimitiveGrok Bot's meta controls make agent oversight a product primitive: approval gates, a chief-of-staff structure and escalation learning, not a settings page.
- Grok Bot Has the Right Shape: Four Primitives, Nothing ElseGrok Bot ships four primitives that compose - a text thread, its own cloud computer, a chief of staff over Bots, and show-it-once routines - and nothing else.
- Grok Bot Routines: Automations Without Automation-BuildingGrok Bot routines let you demonstrate a job once, correct it in plain language and hand the Bot the schedule. How it works and how approval gates keep it safe.
- Grok 4.6: xAI's Agent-Focused Update Matches GPT-5.6 Sol at the Same $2/$6 PriceGrok 4.6 release guide: xAI's agent-focused update matches GPT-5.6 Sol on the AA index at the same $2/$6 pricing, and runs in Cursor and OpenCode.
FAQ
How do I use Grok in Goose?
goose ships a built-in xAI provider configured with XAI_API_KEY (and optional XAI_HOST). Select it with goose configure or the Desktop Models tab, or set GOOSE_PROVIDER/GOOSE_MODEL.
Which Grok model ids work in Goose?
The official docs read for this guide list grok-4.7, grok-4.5, grok-4.3, grok-4.20-0309-reasoning and grok-4.20-0309-non-reasoning. Requests go to https://api.x.ai/v1.
Is this an official Grok and Goose setup?
Goose documents this setup in its own docs. It was last checked against 4 official pages on October 17, 2026.
Sources
Last verified against 4 official pages.
- raw.githubusercontent.comhttps://raw.githubusercontent.com/aaif-goose/goose/main/documentation/docs/getting-started/providers.md
- raw.githubusercontent.comhttps://raw.githubusercontent.com/aaif-goose/goose/main/documentation/docs/guides/environment-variables.md
- raw.githubusercontent.comhttps://raw.githubusercontent.com/aaif-goose/goose/main/crates/goose/src/providers/xai.rs
- docs.x.aihttps://docs.x.ai/developers/models.md
Newsletter
New models, set up the day they ship
One email per week. New model releases, the coding tools that support them and how to wire them up.