Step 7: Connect ChatGPT (Codex)
Power your agent with your own ChatGPT subscription through OpenAI's Codex sign-in.
Your agent needs a language model to think. The recommended option is your own ChatGPT subscription, connected through OpenAI's official Codex sign-in. You don't need an API key, and you won't get per-token bills.
Step 1: Run
officeclaws connect-codexIf you have more than one agent, choose which one with --agent <id>. Run officeclaws agents to see the IDs.
Step 2: Sign in
A browser window opens on OpenAI's sign-in page:
Connect your Codex (ChatGPT) subscription — open this URL and sign in:
https://auth.openai.com/...
Waiting for you to finish signing in (up to 5 min)…
- Sign in with the ChatGPT account that has the subscription.
- Approve the access request.
- The browser shows a confirmation page. Go back to the terminal.
Do this on the same computer where you ran the command. The sign-in sends its result to a temporary local address (
localhost:1455) that the CLI is listening on.
Step 3: Done
✅ Codex connected — your agent now runs on your ChatGPT subscription.
Try it: officeclaws chat
Good to know
- Usage limits. Your agent counts toward your ChatGPT plan's Codex usage limits. When you hit the limit, the agent stops replying until it resets. You might see errors like
rpc final event had no text, or the connection might close. This comes from OpenAI's quota, not from your agent or server. - Free ChatGPT accounts have very low limits and are not recommended.
- Claude subscriptions (Claude Pro / Max / Claude Code) can't be connected this way.
- If the sign-in expires or you switch ChatGPT accounts, run
officeclaws connect-codexagain.