Open-source Grok Bot alternative with a virtual machine that bots can use
ChatGPT plan sign-in
The ChatGPT plan account in Settings → Engines is separate from the legacy
Codex login and Company models. Choose Continue with ChatGPT, authorize plan
usage, then select a model from that account's refreshed catalog. The model slug
is preserved exactly, including gpt-6.1-sol when OpenAI returns it. This does
not migrate existing bots or silently switch their billing. Add another named
ChatGPT account to use another identity; signing out retains its registration.
The desktop implements OpenAI's local open-source flow: loopback callback, state, nonce, PKCE, verified ID-token signatures, issued client IDs, explicit plan-usage consent, account-specific models, rotating refresh tokens, and revocation. It reuses the documented Codex app-server bridge. Access tokens enter only the child environment, not command arguments; shell tools exclude that variable. Every turn starts a new app-server with the current access token, and resume reasserts the selected model/provider. Only a completed native turn counts as success.
Credentials live in private providers/chatgpt-plan/<account-hash>/ directories
under the app data directory, with atomic owner-only files. Portable backups and
the move to My Cloud exclude these provider homes. No Codex credentials or personal
configuration are read or overwritten. A cross-process lock prevents concurrent
refresh-token reuse. If a process dies while holding that lock, the safe recovery
is to stop the old process, confirm it has exited, and remove only that account's
.credentials.lock before reconnecting. We do not guess that a live lock is stale.
Hosted servers (Clouds, hosted workspaces)
The local callback is not a hosted OAuth redirect, so the browser sign-in above
never runs on a hosted server, and a proxied or remote request cannot start it on
a desktop either. There, a ChatGPT account added in Settings is Codex's own login
instead: codex login --device-auth writes into the account's own Codex home,
providers/chatgpt-plan/<account-hash>/codex (owner-only), the same device-code
sign-in the first Codex account uses on a Cloud. codex login status, codex logout, the account name, model list, usage limits and every turn of that
account use that home; the first Codex account keeps $CODEX_HOME or ~/.codex.
The person's Codex setup (config.toml, skills, plugins) is linked in; the login
and chats are not. Do not use the dynamic local client in a paid hosted service,
copy a desktop token to a server, or silently use API billing.
Verification
pnpm exec vitest run server/drivers/chatgpt-plan-auth.test.ts server/drivers/codex.test.ts server/chatgpt-plan-api.test.ts
pnpm exec vitest run src/components/ChatGptPlanSignIn.interaction.test.ts src/components/DeviceSignIn.test.ts src/components/EnginesSettings.test.ts src/components/EngineSetup.test.ts src/components/ModelPicker.interaction.test.ts src/components/ChatView.controls.test.ts
pnpm typecheck
pnpm i18n:check
PROBE_CODEX=/path/to/codex node --experimental-strip-types scripts/verify-chatgpt-plan.mjs
All fixtures use temporary homes and synthetic identities/endpoints; none require a real subscription or modify the user's running app. OAuth tests exercise a real loopback listener and signed synthetic JWTs, rejection of invalid callbacks and identities, denied consent, cancellation, replay, refresh rotation across separate processes, and remote revocation. HTTP tests launch the real server with fake engines and check named account creation, per-admin flow ownership, cancellation, remote refusal, and absence of authorization URLs/tokens from public snapshots.
The native probe uses the installed Codex binary with a temporary home and a
loopback Responses endpoint. On Codex 0.159.0, fresh and resumed gpt-6.1-sol
turns completed with bearer authorization, store:false, stream:true, array
input, and no tool_search. These are transport/protocol checks, not evidence
that a real account has model entitlement or that hosted access is approved.
Before announcing production availability, complete one real desktop consent flow with the account owner and a short model reply. No real sign-in or paid inference was performed during this implementation.