Feature request: xAI Grok SuperGrok / Premium+ OAuth login (was PR #1932) #1933
ziliangpeng
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
/loginalready supports subscription OAuth for ChatGPT Plus/Pro, Claude Pro/Max, and GitHub Copilot. The built-inxaiprovider still only acceptsXAI_API_KEY. SuperGrok / Premium+ users cannot authenticate with their subscription.Proposal
Add a built-in
xaiOAuth provider so/login→ xAI (Grok SuperGrok / Premium+) uses RFC 8628 device authorization againstauth.x.ai. No local callback server, so it works over SSH and other headless setups. The access token is used as the Bearer token for the existingopenai-completionsclient athttps://api.x.ai/v1.This is auth only: no model-catalog changes, no reasoning-effort changes, and no unrelated extensions.
Details:
/logoutfirst because stored OAuth credentials take priority overXAI_API_KEYImplementation already on a branch
PR (auto-closed by the vouched-author gate): #1932
Branch, rebased onto current
main: https://github.com/ziliangpeng/prime-agent/tree/feat/xai-oauthCompare: main...ziliangpeng:feat/xai-oauth
One commit, seven files, +813 / −4:
packages/ai/src/utils/oauth/xai.tspackages/ai/src/utils/oauth/index.tspackages/ai/test/xai-oauth.test.ts(18 tests)packages/coding-agent/src/modes/interactive/auth-flows.tspackages/coding-agent/docs/providers.mdpackages/aiandpackages/coding-agentValidation on that branch:
npm test --workspace @earendil-works/pi-ai -- test/xai-oauth.test.ts— 18/18tsgo --noEmit, installer render, browser smokeI have been using this OAuth path locally against live
api.x.ai(device login, token refresh, Grok 4.6 completions).Ask
ziliangpeng:feat/xai-oauth, and vouchziliangpengso the contribution gate can accept the PR?I can keep the branch rebased on
mainand adjust the design if needed.All reactions