Setup guide - Documented by GitHub Copilot
Use Grok in GitHub Copilot
Grok 4.5, 4.6 and 4.7 (provider xAI) are GA built-in Copilot models on Pro, Pro+, Max, Business and Enterprise, available in VS Code, Visual Studio, JetBrains, Eclipse, Xcode and Copilot CLI. VS Code can also reach the xAI API directly via BYOK Custom Endpoint.
Last verified 4 steps6 official sources
Steps
- Step 1.
Built-in: open Copilot Chat by clicking the chat icon in the title bar of Visual Studio Code. At the bottom of the chat view, select the CURRENT-MODEL dropdown menu, then click Grok 4.7.
- Step 2.
BYOK with your own xAI key (VS Code): open the Language Models editor (Manage Language Models gear icon, or Chat: Manage Language Models), select Add Models, select Custom Endpoint, enter a group name, a display name and API key, and select the API type Responses.
- Step 3.
In the chatLanguageModels.json file VS Code opens, configure the model. Documented Custom Endpoint shape, filled with xAI's documented endpoint and model id:
JSON[ { "name": "xAI", "vendor": "customendpoint", "apiKey": "${input:xaiApiKey}", "apiType": "responses", "models": [ { "id": "grok-4.7", "name": "Grok 4.7", "url": "https://api.x.ai/v1/responses", "toolCalling": true, "vision": true, "contextWindow": 500000 } ] } ] - Step 4.
Select the model from the model picker in chat (restart VS Code if it does not appear).
Caveats
- Built-in Grok models are not available on github.com (dotcom: false in GitHub's supported-clients table), and Copilot Free is not listed in the supported-plans table.
- On Copilot Business or Enterprise, admins control model and BYOK availability via Copilot policy settings.
- The BYOK JSON combines VS Code's documented Custom Endpoint format with xAI's base URL and model id; it is not an xAI-documented integration. xAI's Responses API is stateful by default upstream, but if you hit missing-tool-call errors VS Code documents setting statefulResponses to false.
- BYOK covers chat and utility tasks only; inline suggestions still use GitHub's models. The older github.copilot.chat.customOAIModels setting is deprecated.
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 GitHub Copilot?
Grok 4.5, 4.6 and 4.7 (provider xAI) are GA built-in Copilot models on Pro, Pro+, Max, Business and Enterprise, available in VS Code, Visual Studio, JetBrains, Eclipse, Xcode and Copilot CLI. VS Code can also reach the xAI API directly via BYOK Custom Endpoint.
Which Grok model ids work in GitHub Copilot?
The official docs read for this guide list Grok 4.7, Grok 4.6, Grok 4.5 and grok-4.7. Requests go to https://api.x.ai/v1.
Is this an official Grok and GitHub Copilot setup?
GitHub Copilot documents this setup in its own docs. It was last checked against 6 official pages on October 17, 2026.
Sources
Last verified against 6 official pages.
- raw.githubusercontent.comhttps://raw.githubusercontent.com/github/docs/main/data/tables/copilot/model-release-status.yml
- raw.githubusercontent.comhttps://raw.githubusercontent.com/github/docs/main/data/tables/copilot/model-supported-plans.yml
- raw.githubusercontent.comhttps://raw.githubusercontent.com/github/docs/main/data/tables/copilot/model-supported-clients.yml
- docs.github.comhttps://docs.github.com/en/copilot/how-tos/copilot-in-your-ide/chat-with-copilot/change-the-chat-model
- raw.githubusercontent.comhttps://raw.githubusercontent.com/microsoft/vscode-docs/main/docs/agent-customization/language-models.md
- docs.x.aihttps://docs.x.ai/developers/grok-4-7.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.