Skip to main content
Watch: I Built an AI App Without Leaving Databricks

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

  1. 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.

  2. 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.

  3. 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
          }
        ]
      }
    ]
  4. 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.

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.

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.