Grok (xAI subscription)
Run Claude Code's roles on xAI's Grok models through your SuperGrok subscription, with no API key. You need a SuperGrok subscription.
Do this for me on this machine: sign in to Grok with my SuperGrok subscription and make it available as a profile. This is superclaude's own guide. Read all of it as raw Markdown first, without summarizing it: curl -fsSL "https://superclaude.io/docs/provider-grok.md" Then: 1. Tell me in a few lines what you are going to change. 2. Do every step yourself: run the commands, edit the files, check each result. 3. Stop only for what needs me: a browser sign-in, a choice between options, a secret to paste. 4. Finish by showing it works, and tell me the one command I will use from now on. Other superclaude pages, if you need them: https://superclaude.io/llms.txt
Grok is a SuperGrok subscription that sc reaches over xAI’s OpenAI-compatible API, signed in with OAuth. Four steps declare it, sign you in and launch on it.
-
Add the grok endpoint and a profile
Paste this into
~/.superclaude/config.toml. The filescwrites on first run already carries the endpoint commented out, so you can uncomment it instead.[endpoints.grok] url = "https://api.x.ai" format = "openai-compat" auth = "oauth" [endpoints.grok.oauth] provider = "grok" [profiles.grok] opus = { slug = "grok/grok-4-fast" }The part after
grok/is any model id your subscription serves;grok-4-fastis the shipped example. This profile maps onlyopus, so every role uses it. -
Sign in
sc auth grokYour browser opens and
scwaits for you to finish the sign-in. -
Check the routing
sc profiles grokIt prints a row for each of opus, sonnet and haiku with the model that role maps to; roles you did not set are marked as inherited.
-
Launch on it
sc -u grok <project> <agent>The profile is a full gateway, so your Claude login is not used (what changes).
sc auth grok stores the tokens in config.toml under [endpoints.grok.oauth.identities.default], and the daemon refreshes them. sc auth list shows each identity and its expiry.
I have no browser on this machine
Run the device flow instead. It prints a URL and a one-time code to open on any device.
sc auth grok --deviceHow is Grok different from Codex?
Sign-in, labels, re-authentication and sc auth list work exactly as on Codex. The differences:
| Codex | Grok | |
|---|---|---|
| Browser callback | localhost:1455 | 127.0.0.1:56121 |
| Wire format | openai-responses | openai-compat |
| Account header | ChatGPT-Account-Id | none |
| Rate limit | per ChatGPT account | per subscription |
sc usage | plan windows | one monthly window |
Can I add a second Grok login?
Yes, with a second label. It adds headroom only for a different subscription, because the rate limit is per subscription.
sc auth grok --label <name>Does reasoning effort work on a Grok row?
No. The gateway has no reasoning field for Grok model ids, so a reasoning value on a Grok row sends nothing and the model uses its own default. temperature and params are sent as written.
Use Grok and Codex in one profile
The config sc writes on first run includes this profile, commented out. Sign in to both endpoints before you launch it.
[profiles.subscriptions]
opus = { slug = "codex/gpt-5.5", reasoning = { effort = "high" } }
sonnet = { slug = "codex/gpt-5.4" }
haiku = { slug = "grok/grok-4-fast" }To keep Claude on the main loop instead, point opus at the anthropic passthrough endpoint (Anthropic and Claude).
Next: OpenRouter