Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Grok ChatNew to Visual Studio Code? Get it now.
Grok Chat

Grok Chat

AnUnknownArtist

|
3,774 installs
| (1) | Free
Independent Grok coding workspace for VS Code with OAuth, API key support, project context, secure tools, and voice input.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Grok Chat for Visual Studio Code

Grok Chat

A focused Grok coding workspace, directly inside VS Code.
Chat about code with Grok or optional OpenRouter models, work securely with projects, and create images or videos with Grok Imagine without leaving the editor.

VS Code 1.104+ Independent extension OAuth or API key Grok Imagine included Languages

[!IMPORTANT] Grok Chat is an independent, unofficial extension. It is not affiliated with, endorsed by, or sponsored by xAI. Grok, xAI, and related names belong to their respective owners.

[!TIP] Experimental in 1.3.6: Grok Imagine can use the active SuperGrok OAuth session even when no xAI API key is configured. This experimental route is enabled by default, is clearly identified before generation, and may still be rejected or limited by xAI. An xAI API key remains the stable alternative.

Why install Grok Chat?

The most complete Grok workspace for Visual Studio Code.

Use Grok directly inside your editor with OAuth authentication, API Keys, project-aware conversations, voice input, secure credential storage and powerful developer tools.

✔ OAuth Login

✔ xAI API Key Support

✔ OpenRouter (Claude, GPT, Gemini, DeepSeek, Llama, free models)

✔ Project Context

✔ Multi Conversation Chat

✔ Voice Input

✔ Grok Imagine Image & Video Generation

✔ Tool Calling

✔ Secure Secret Storage

✔ VS Code Native Experience

Preview

Grok Chat running in Visual Studio Code

Screenshots

Get started

  1. Install Grok Chat from the Visual Studio Marketplace or from a trusted .vsix.
  2. Open a folder in VS Code.
  3. Select the Grok Chat icon in the Activity Bar.
  4. Connect with Grok OAuth, an xAI API key, or the optional OpenRouter provider.
  5. Choose a model and start a conversation.

Grok / xAI is always the initial provider. OpenRouter is optional and can be connected later from the same panel without changing an existing Grok setup.

The first-run experience can prepare a new project, integrate guidance into an existing project, or skip setup and open chat immediately.

Authentication: two separate modes

Grok Chat never treats OAuth and API billing as the same thing.

Mode 1 — Grok OAuth

  • Opens the browser so you can sign in with your Grok account.
  • Uses the subscription and access available to that account.
  • Does not require an xAI API key.
  • Stores the resulting OAuth session in VS Code Secret Storage.

Mode 2 — xAI API

  • Requires an API key created for api.x.ai.
  • Uses the xAI API independently from the OAuth subscription mode.
  • May consume paid credits or generate costs according to the xAI account.
  • Stores the API key in VS Code Secret Storage.

If both credentials exist, Settings clearly shows which method is active. Switching methods does not silently delete the other credential.

Optional provider — OpenRouter

Grok / xAI remains the default experience, but OpenRouter provides an optional route to a broader model catalog—including Claude, GPT, Gemini, DeepSeek, Llama, and other families—without replacing your Grok connection.

  • Connect through OpenRouter's browser authorization flow or enter an OpenRouter API key.
  • Start with Free Auto ⚡, or choose catalog entries marked FREE / :free when available.
  • Free models use OpenRouter's account quotas and provider rate limits. They are useful for trying models and lighter work, but they are not guaranteed to be unlimited or continuously available.
  • Paid models are clearly separated and show input/output pricing whenever OpenRouter supplies it.
  • Switch between xAI and OpenRouter from the composer; each provider keeps an independent connection state and model list.

OpenRouter credentials are stored in VS Code Secret Storage. Requests made with this provider are sent directly to OpenRouter and are subject to its current quotas, pricing, availability, and privacy terms.

Grok Imagine: images and video

Choose Imagine from the mode selector at the bottom of the chat panel. In this experimental 1.2.1 test build, an active SuperGrok OAuth session can enable Imagine when no xAI API key is saved.

  • Generate or edit images with Standard or Quality models, 1K/2K resolution, configurable aspect ratio, and up to four variations.
  • Attach up to three PNG, JPEG, or WebP reference images for image editing and composition.
  • Generate videos from text or animate a source image, with 1–15 second duration and supported 480p/720p/1080p choices depending on the selected model.
  • Use multiple references with compatible video models; invalid model/input combinations are disabled.
  • Review the estimated output cost before higher-cost requests. Video and multi-image requests require confirmation.
  • Results are downloaded from xAI's temporary URL into private extension storage and can be opened, exported, or deleted from the Imagine gallery.

xgrok.experimentalImagineOAuth is enabled for this test build. The interface identifies this route as experimental and asks for confirmation before generation. xAI may reject the OAuth credential because its public Imagine API documents API-key authentication; the setting can be disabled to restore API-key-only behavior.

Models

The provider picker keeps Grok / xAI ★ first and offers OpenRouter as an optional second provider. The xAI model picker combines three sources:

  1. A stable built-in fallback so the extension remains usable offline or when discovery is unavailable.
  2. Models dynamically available to the active authenticated xAI account.
  3. Optional custom model IDs configured by the user.

Dynamic discovery is best effort. A discovery error never disables the static fallback.

OpenRouter models are discovered from its public catalog and cached for 45 minutes. The list groups Free Models, Claude, OpenAI, Google, DeepSeek, Llama, Mistral, Qwen, and Other when the catalog metadata supports that grouping. Free Auto ⚡ (openrouter/free) is pinned first; :free variants and zero-priced catalog entries receive a FREE label. Pricing is displayed only when supplied by OpenRouter.

OpenRouter can be connected with its browser PKCE flow or with a manually entered sk-or-v1-… key. Both routes store the resulting credential only in VS Code Secret Storage and select OpenRouter for the next chat. Grok / xAI and OpenRouter have independent connection and disconnect controls; disconnecting either provider preserves the other provider and existing conversations. If an OpenRouter model disappears, the selector falls back to Free Auto.

Workspace context

Mode What it includes Best for
Min Conversation and manually attached files or folders Quick questions and maximum context control
Smart A focused project tree plus a small set of relevant files Everyday coding; recommended
Deep A broader tree and more key-file content Architecture reviews and larger tasks

Automatic context excludes common credential-bearing files such as .env, private keys, and cloud credential files. Regular files can still be attached manually when appropriate.

When the opened workspace contains a project inside a subfolder, Grok Chat automatically detects the most likely project root (up to two levels deep) using common markers such as package.json, tsconfig.json, pyproject.toml, or go.mod. The opened workspace remains the security boundary. Changing the VS Code workspace clears and reloads the project map.

Permissions and user control

Mode Reads Writes, deletes, terminal
Ask Before Changes Allowed automatically inside the workspace Requires confirmation before each protected action, unless allowed for the current chat
Full Workspace Access Allowed automatically inside the workspace Allowed tools run without repeated prompts after VS Code trusts the workspace

Both modes retain these controls:

  • Paths are constrained to the open workspace.
  • Absolute paths and traversal outside the workspace are rejected.
  • Symlink and junction escapes are checked against canonical paths.
  • Terminal commands are restricted by allowlist and denylist policies.
  • Full Workspace Access requires VS Code Workspace Trust.
  • A repository cannot grant itself Full Workspace Access through workspace settings.

Grok Chat cannot use its agent file tools to browse or change arbitrary locations outside the open workspace. Full Workspace Access is not an operating-system sandbox; enable it only for workspaces and tasks you trust.

Privacy

Grok Chat does not include advertising, analytics, or behavioral telemetry, and it does not sell personal data.

When you send a model request, the payload can include:

  • Your prompt and conversation messages.
  • Files or folders you attached.
  • Project context produced by the selected context mode.
  • Tool definitions and tool results required to complete the conversation.

Additional network activity occurs only for the feature being used:

  • OAuth communicates with xAI authentication services.
  • API chat communicates with the allowlisted api.x.ai endpoint.
  • OpenRouter model discovery and selected OpenRouter chat requests communicate directly with https://openrouter.ai/api/v1; no project-owned proxy is used.
  • Imagine sends prompts and explicitly attached reference images to the official xAI image/video endpoints. Generated media is downloaded from allowlisted xAI media hosts into extension-owned local storage.
  • SuperGrok usage refresh performs a separate authenticated usage request.
  • Local voice stays on the device.
  • Opt-in xAI voice sends microphone audio to xAI for transcription while the microphone session is active.

OAuth tokens, xAI/OpenRouter API keys, and a dedicated voice key are persisted only through VS Code Secret Storage. Chat history stores the provider/model choice locally in VS Code workspace storage after secret redaction; embedded image data is not retained in persisted history. Temporary xAI voice recordings are deleted on a best-effort basis after transcription.

Imagine assets are stored separately under VS Code's extension global storage until deleted or exported. They are not written into the opened repository automatically. Imagine generation is metered by xAI and may consume API credits; cancellation after a request starts does not guarantee that xAI will not charge it.

Local history storage does not mean inference requests are zero-retention. According to xAI's API data policy, API inputs and outputs are normally retained encrypted for up to 30 days for abuse and security auditing and are not used for training without explicit permission. Teams enrolled in xAI Zero Data Retention have different behavior, but some server-side features such as stateful Responses, Files, and Collections are unavailable. Grok Chat continues to work with local history and Chat Completions when those features are unavailable.

Security

  • OAuth authorization code flow with PKCE, state, and nonce validation.
  • OS-backed VS Code Secret Storage for persisted credentials.
  • Strict allowlist before authentication headers can be sent.
  • Webview Content Security Policy and validated message types.
  • Escaped model output; raw model HTML is not executed.
  • Secret redaction in errors, history, and tool activity.
  • Workspace Trust, path protection, and protected tool approval.
  • Exact command/URL previews with session-scoped terminal, network, and commit approval.
  • Patched PDF parsing with generated-code evaluation disabled and bounded resource use.

Voice input

The microphone communicates its current state: ready, opening, listening, processing, or error.

  • Local: private Windows speech recognition with system dictation fallback.
  • xAI: opt-in cross-platform transcription; requires explicit consent, FFmpeg, and may be metered.
  • Auto: selects local voice on Windows and xAI voice on macOS or Linux.

The phrase grok send can submit the final transcript hands-free. If a response is already running, the prompt joins the existing queue.

VS Code Chat

Use @grok in the built-in Chat view:

  • /explain
  • /fix
  • /tests
  • /refactor

Commands

Command Purpose
Grok Chat: Open Grok Chat Focus the sidebar
Grok Chat: Open Grok Chat in Editor Open the complete chat in an editor tab
Grok Chat: Sign in with SuperGrok Start OAuth login
Grok Chat: Sign out Clear the session and local secrets
Grok Chat: Open Connect Screen Manage authentication
Grok Chat: Clear API Key only Remove only the stored API key
Grok Chat: Open VS Code Chat with @grok Open the built-in Chat view

Requirements

  • Visual Studio Code 1.104 or later, or a compatible host.
  • A Grok account with applicable access, an xAI API key, or an OpenRouter account/key.
  • An open workspace folder for project context and file tools.
  • Microphone permission for voice input.
  • FFmpeg only when using xAI voice capture.

FAQ

Is this an official xAI extension?

No. Grok Chat is independent and is not affiliated with, endorsed by, or sponsored by xAI.

Does OAuth use my API credits?

OAuth and API key mode are separate. OAuth uses access associated with the signed-in Grok account. API key mode uses api.x.ai and may consume paid API credits.

Can a project enable Full Workspace Access itself?

No. The extension accepts Full Workspace Access only from the user's global configuration and only after VS Code trusts the workspace.

Are my credentials stored in the project?

No. Persisted credentials use VS Code Secret Storage, not project files or normal workspace settings.

Why do some models appear or disappear?

Dynamic models reflect what the active account reports. The built-in fallback remains available when discovery cannot be completed, and custom model IDs can be added in Settings.

Are OpenRouter free models unlimited?

No. OpenRouter may offer free model variants and the Free Auto ⚡ route, but they remain subject to account quotas, provider rate limits, capacity, and catalog changes. Grok Chat labels free and paid choices separately; always review the selected model before sending a request.

Troubleshooting

Login does not complete

  • Finish the browser authorization and return to VS Code.
  • Retry Sign in with SuperGrok from the Command Palette.
  • Check whether a firewall is blocking the temporary localhost OAuth callback.

API key validation fails

  • Confirm the key belongs to xAI and has access to the chosen model.
  • Check account credits and endpoint permissions.
  • Save without validation only when you understand that the first real request may still fail.

Workspace tools are unavailable

  • Open a folder rather than an empty VS Code window.
  • Trust the workspace for protected actions.
  • Check whether Ask Before Changes is waiting for an approval card.

Voice input does not start

  • Allow microphone access for the VS Code host application in operating-system privacy settings.
  • For xAI voice, install FFmpeg or configure its machine-specific path.
  • Select a microphone device if automatic detection chooses the wrong input.

Try LocalMan

Looking for another way to improve your local development workflow? Discover LocalMan, a companion VS Code extension from An Unknown Artist. Give it a try and bring more of your everyday tools directly into the editor.

License

This project is source-available under the PolyForm Noncommercial License 1.0.0. You may use, modify, and distribute it for noncommercial purposes. Commercial use, sale, monetization, sublicensing, and transfer of rights are not permitted without prior written authorization.


Created by An Unknown Artist. Contact www.anunknownartist.com

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft