Use Grok language models inside OpenCode without needing to copy or manage an xAI API key.
Switch between four Grok model variants including a reasoning model and a fast model from within OpenCode.
Install a TypeScript OpenCode plugin built with Bun that handles OAuth token refresh automatically in the background.
Manual installation requires Bun to build locally and placing the output file in OpenCode's global plugins folder, npm publication is pending.
This is a plugin for OpenCode, an AI coding tool, that adds support for xAI's Grok language models. Normally, connecting to Grok requires an API key. This plugin takes a different approach: it logs you in through xAI's own OAuth flow, the same login mechanism used by the SuperGrok subscription service, so you can use Grok inside OpenCode without managing an API key. OAuth is a standard way of handling logins where you approve access in a browser rather than copying a token from a dashboard. When you run the login command, the plugin opens a browser window pointing to xAI's authorization page, you sign in with your xAI account, and the plugin receives a short-lived access token that it stores and refreshes automatically in the background. The token is only ever sent to xAI's own API address, and the plugin includes a safety check that blocks it from going anywhere else. The plugin registers four Grok models in OpenCode's provider list: a general-purpose model, a reasoning-focused variant, a faster non-reasoning variant, and a multi-agent variant. You select which one to use from within OpenCode the same way you would select any other supported model. Installation is currently manual. You build the plugin locally using Bun, a JavaScript runtime, place the output file in OpenCode's global plugins folder, and add a provider block to OpenCode's configuration file. The README includes step-by-step instructions for Windows, with PowerShell commands for each step. Once published to npm, the setup will be simpler. The plugin is released under the MIT license. The README credits the implementation pattern to two other open-source projects: an Antigravity Auth plugin by a separate author and xAI OAuth work by Nous Research.
← ysnock404 on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.