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.

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.

  1. Add the grok endpoint and a profile

    Paste this into ~/.superclaude/config.toml. The file sc writes 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-fast is the shipped example. This profile maps only opus, so every role uses it.

  2. Sign in

    sc auth grok

    Your browser opens and sc waits for you to finish the sign-in.

  3. Check the routing

    sc profiles grok

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

  4. 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 --device
How is Grok different from Codex?

Sign-in, labels, re-authentication and sc auth list work exactly as on Codex. The differences:

CodexGrok
Browser callbacklocalhost:1455127.0.0.1:56121
Wire formatopenai-responsesopenai-compat
Account headerChatGPT-Account-Idnone
Rate limitper ChatGPT accountper subscription
sc usageplan windowsone 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

View as Markdown