ChatGPT plan
Connect a ChatGPT plan to AI Wallet through OpenAI's device sign in for Codex, with the Codex model list and the room of the plan's two usage windows.
The ChatGPT account answers with the visitor's ChatGPT subscription, through the Codex backend of the plan. The wallet lists it as ChatGPT under "With your plan", with the id chatgpt. An OpenAI API key is a separate account, described on the OpenAI API key page.
What the visitor needs
A ChatGPT plan. The answers come from the plan's Codex backend and count against the plan.
Sign in
- In the wallet, the visitor picks ChatGPT under "With your plan".
- The wallet asks OpenAI for a device code and shows the code in the side panel.
- It opens a window on
https://auth.openai.com/codex/device. - The visitor signs in to ChatGPT there and approves the code.
- The wallet asks OpenAI for the approval each time a page finishes loading in the window, when the window closes, and when the visitor presses "I approved it". OpenAI answers 403 or 404 until the visitor approves.
- Once approved, the wallet trades the authorization code for tokens, reads the workspace of the token (
chatgpt_account_id), and the account is connected.
The code lasts fifteen minutes. The wallet renews the access token with the refresh token from one minute before it expires.
Models
The wallet lists the models Codex shows, from https://chatgpt.com/backend-api/codex/models for the Codex release 0.166.0: the models OpenAI marks for the list, in OpenAI's order of priority. It keeps the list for a day. The visitor picks the account's default model in its settings, and a model per site with the buttons of the side panel. Without a choice, the account answers with gpt-6-luna.
Usage and limits
The wallet reads x-codex-primary-used-percent and x-codex-secondary-used-percent on each answer, the percent used of the plan's two windows. The room left is one minus the higher of the two, as a share.
When ChatGPT returns x-codex-rate-limit-reached-type, the account reads as spent. Auto then tries it last.
Calls
Answers come from https://chatgpt.com/backend-api/codex/responses in OpenAI's Responses protocol. Each call carries the token and the workspace in a ChatGPT-Account-ID header, and asks the backend to store nothing (store: false).
The Codex backend refuses the sampling settings and the output limit, so the wallet leaves maxTokens, temperature and topP out of its calls. The Responses protocol has no stop sequences, and the wallet leaves stop out as well.
Known issues
- The sign in borrows the OAuth client of Codex, OpenAI's command line tool.
- The calls present themselves as Codex, with
originator: codex_cli_rsandUser-Agent: codex_cli_rs/0.0.0.
Claude plan
Connect a Claude plan to AI Wallet through the sign in of Claude Code, with Anthropic's model list and the room of the plan's five hour and weekly windows.
Gemini plan
Connect a Gemini plan to AI Wallet through the Google sign in of the Antigravity app, with the models of Antigravity's agent.