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

Setup guide - Documented by Zed

Use Grok in Zed

Zed has a native xAI provider for the Zed Agent: enter an xAI API key in Agent Settings (or set XAI_API_KEY), and add custom Grok model ids under language_models.x_ai.

Last verified 3 steps4 official sources

Steps

  1. Step 1.

    Create an API key in the xAI Console (https://console.x.ai/team/default/api-keys).

  2. Step 2.

    Open Agent Settings (agent::OpenSettings) and go to the xAI section. Enter your xAI API key. Zed also reads XAI_API_KEY from the local Zed process environment.

  3. Step 3.

    To add Grok ids Zed does not list yet, add custom xAI models in settings.json. Documented format (Zed's example uses grok-1.5; replace name with a current id such as grok-4.7 and limits from xAI's model page):

    JSON
    {
      "language_models": {
        "x_ai": {
          "api_url": "https://api.x.ai/v1",
          "available_models": [
            {
              "name": "grok-1.5",
              "display_name": "Grok 1.5",
              "max_tokens": 131072,
              "max_output_tokens": 8192
            }
          ]
        }
      }
    }

Caveats

  • Zed's custom-model example uses grok-1.5 / grok-1.5v, which are not current xAI ids. Substituting grok-4.7 (500,000 token context per xAI) combines Zed's documented settings shape with xAI's model page.
  • This configures the Zed Agent and other Zed-owned AI features, not External Agents or Terminal Threads.
  • Zed's provider setup moved from the LLM Providers page to Use API Access.

FAQ

How do I use Grok in Zed?

Zed has a native xAI provider for the Zed Agent: enter an xAI API key in Agent Settings (or set XAI_API_KEY), and add custom Grok model ids under language_models.x_ai.

Which Grok model ids work in Zed?

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 Zed setup?

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

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.