Setup guide - Documented by Roo Code
Use Grok in Roo Code
Roo Code has a native xAI provider: choose xAI in API Provider, paste an xAI API key into the xAI API Key field, and select a Grok model.
Last verified 5 steps3 official sources
Steps
- Step 1.
Go to the xAI Console (https://console.x.ai/), sign in, open the API keys section, create a new key (e.g. named "Roo Code") and copy it immediately.
- Step 2.
Open Roo Code Settings: click the gear icon in the Roo Code panel.
- Step 3.
Select Provider: choose "xAI" from the "API Provider" dropdown.
- Step 4.
Enter API Key: paste your xAI API key into the "xAI API Key" field.
- Step 5.
Select Model: choose your desired Grok model from the "Model" dropdown (current xAI ids include grok-4.7).
Caveats
- Roo Code's page names older models (grok-code-fast-1, grok-4.1-fast, grok-4, grok-3, grok-3-mini). xAI retired grok-code-fast-1, grok-3, grok-4-0709 and the grok-4(-1)-fast slugs on May 15, 2026; they now redirect to grok-4.3 (or grok-build-0.1 for grok-code-fast-1) and bill at the new model's price.
- Roo Code says it supports all Grok models available through xAI's API, but the dropdown contents depend on the installed version.
- Roo Code docs now live at roocodeinc.github.io/Roo-Code (docs.roocode.com redirects there).
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 Roo Code?
Roo Code has a native xAI provider: choose xAI in API Provider, paste an xAI API key into the xAI API Key field, and select a Grok model.
Which Grok model ids work in Roo Code?
The official docs read for this guide list grok-4.7, grok-4.6, grok-4.5, grok-4.3 and grok-build-0.1. Requests go to https://api.x.ai/v1.
Is this an official Grok and Roo Code setup?
Roo Code documents this setup in its own docs. It was last checked against 3 official pages on October 17, 2026.
Sources
Last verified against 3 official pages.
- roocodeinc.github.iohttps://roocodeinc.github.io/Roo-Code/providers/xai/
- docs.x.aihttps://docs.x.ai/developers/models.md
- docs.x.aihttps://docs.x.ai/developers/migration/may-15-retirement.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.