Add xAI SuperGrok/X Premium OAuth login - #677
Open
MrDllmai wants to merge 1 commit into
Open
Conversation
Register xAI in the existing tau_coding OAuth registry so SuperGrok and X Premium users can run /login xai without an API key. Device-code requests identify Tau with referrer=tau. API-key login stays available via /login xai-api. Logout of openai-compatible OAuth providers no longer fails as a missing API key after the stored grant is deleted.
MrDllmai
force-pushed
the
feat/xai-oauth
branch
from
September 4, 2026 11:32
1121e04 to
34855f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
xAI is already a built-in OpenAI-compatible catalog provider, but login was API-key only. SuperGrok / X Premium users can authenticate with an RFC 8628 device-code flow against
auth.x.ai. This PR registers that flow in the existingtau_codingOAuth registry so/login xaiworks without a paid API key.Related: #676, #370, #372.
Behavior
/login→ Subscription lists xAI (SuperGrok / X Premium)./login xaiand/login xai-subscriptionstart the device-code flow (referrer=tau)./login xai-apistill saves an API key.auth_methods = ["api_key", "oauth"].https://api.x.ai/v1. Refresh keeps the previous refresh token if xAI omits a new one./logout xairemoves the stored OAuth grant. openai-compatible OAuth logout no longer fails as a missing API key after the credential is deleted.Tests and checks
uv run pytest— 1865 passed, 3 skippeduv run ruff check .uv run ruff format --check .uv run mypyhugo --minifyinwebsite/(Hugo 0.152.2 extended)referrer=tau), pending, denial, expiry, untrusted URI, malformed JSON, refresh rotation, omitted refresh token, and secret redaction/login xai, aliases, subscription picker, and logout messagingreferrer=taureturned HTTP 200 (login not completed in CI)uv run tau --provider xai --model grok-4.6 -p "Reply with exactly: XAI-OAUTH-OK"Compatibility
XAI_API_KEY/ API-key login is unchanged.referrer=tau.auth.x.aialready accepts for CLI device login. Replace it if xAI issues a Tau-owned client.website/content/guides/providers-and-models.md,quickstart.md,slash-commands.md,dev-notes/architecture/xai-oauth.md.