grok accounts - #29
Open
pedroapfilho wants to merge 1 commit into
Open
Conversation
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.
Adds xAI as a third provider: Grok accounts sign in, switch, auto-rotate and meter alongside Codex and Claude Code.
What
tokenmaxx login grokruns the officialgrokCLI against an isolatedGROK_HOME, importsauth.json(OIDC session againsthttps://auth.x.ai), stores it in the keychain and refreshes it in-process.--api-keyaccounts go toapi.x.ai.[endpoints] cli_chat_proxy_base_urlin~/.grok/config.toml, written inside an existing[endpoints]table when there is one, reclaimed if grok re-serialises the file.install,uninstall,doctor, heal-on-update and the dashboard settings toggle all cover it.limitwindow (reset fromretry-after) and the probe clears it once the reset passes. That is what makes Grok accounts eligible for rotation and the proxy's retry-on-next-account.PROVIDERStable indomain.tsreplaces the scattered vendor/app/cli name lookups;installStatus()returnsrouted: Record<ProviderId, boolean>;tokenmaxx auto allreplacesboth.src/login.ts(isolated-login dependencies, codex uses it too) andreadApiKeyinvault.ts.tokenmaxx-xaiprovider, README updated.Verified live
tokenmaxx login grok→ device-code flow → signed in, config routed.grok -p "say hi" --no-auto-update→ answered through the proxy;token_eventshasgrok-4.6-buildrows (4063 in / 35 out).bun run check: typecheck, biome, 111 tests (16 new:grok.test.ts, xai cases inratelimit.test.tsandconfig-install.test.ts).Known limits
null— nothing inauth.jsonor userinfo names the subscription.grok-4.6-build, priced at the grok-4.6 rate; adjust inpricing.tsif xAI lists it differently.userinfoare exercised by the 60 s probe; the first refresh happens ~6 h after login.