-
Notifications
You must be signed in to change notification settings - Fork 3
Connecting to ChatGPT
Codex Free connects to ChatGPT through a developer-mode connector. There are two connection styles: the native OpenAI tunnel (recommended — no public URL) and an externally managed tunnel (you run the proxy).
-
In ChatGPT, enable Developer mode.
-
Configure
openaiTunnelincodex.config.json(or usecodex-free quickstart), export the referenced runtime key, and start Codex Free. Keep the process running for connector discovery and every tool call. -
In ChatGPT's connector/plugin settings, create a developer-mode connector with Connection type: Tunnel.
-
Select the same tunnel ID that Codex Free reports as ready. Set Authentication to None.
-
Set the connector's permissions to Allow all actions if you don't want per-call confirmations.
-
Enable the connector in a new chat and open with:
Call get_agent_brief and follow it for the rest of this chat. Task: <what you want done>
There is no server URL to enter in this mode. OpenAI routes the selected tunnel to the supervised client, which supplies Codex Free's generated per-process bearer on the local hop. The startup banner prints the runtime-only /readyz and /metrics URLs; it does not advertise an admin UI because tunnel-client-runtime omits that surface.
Set conversationAuthToken in codex.config.json (32–256 ASCII bytes) to require each new chat to prove it before any tool works. When it's set, every tool except authenticate is refused until the conversation calls authenticate with the matching token; after that, the grant is remembered for that ChatGPT conversation (restored across MCP reconnects and restarts from a hashed record under ~/.codex-free/conversation-authorizations/, or scoped to the transport session for non-ChatGPT clients). Leave it unset to allow any conversation that can reach the connector. The wizard does not create this token — add it by hand. See Configuration and Security Model.
-
Create or obtain a tunnel ID in OpenAI Platform → Tunnels.
-
Create a restricted runtime API key whose principal has Tunnels Read + Use for that tunnel. Keep tunnel-management/admin credentials separate.
-
Reference the key from config — never paste the literal key:
{ "openaiTunnel": { "tunnelId": "tunnel_0123456789abcdef0123456789abcdef", "apiKeyRef": "env:CONTROL_PLANE_API_KEY" } } -
Provide the key and start:
export CONTROL_PLANE_API_KEY='...' codex-free --work-dir /path/to/your/project
The wizard (codex-free quickstart) does all of this for you and stores the key in a locked-down file: reference under ~/.codex-free/openai-tunnel/credentials/ — see Quick Start.
Set openaiTunnel.clientPath or pass --openai-tunnel-client /path/to/tunnel-client-runtime. Codex Free still checks the binary's version surface and required flags before starting it.
- Start Codex Free without
openaiTunnel(add--multi-projectfor one connector shared across projects). - Put an authenticated reverse proxy or tunnel in front of port
3000. - Create a URL-based developer connector whose server URL is the resulting HTTPS URL with
/mcpappended. - Configure the connector authentication your client supports, and enforce access controls at the proxy/tunnel layer.
ngrok http 3000 is fine for a disposable connectivity test, but an unprotected public URL is not an appropriate long-lived deployment. Use provider access policies, source restrictions, mTLS, OAuth, or another control. --api-key helps MCP clients that send a static bearer, though ChatGPT's connector auth may not support that form directly. Read Security Model before exposing this mode.
instructions is the proper channel, but ChatGPT Web isn't reliable about showing it to the model. One line fixes that:
Call get_agent_brief and follow it for the rest of this chat.
Task: <what you want done>
Everything — the shell you're on, the allowlist, your repo's AGENTS.md, any saved plan — arrives with that one call. If a chat drifts back into generic-assistant behaviour, ask for the brief again to re-anchor it.
Select the project first. With an exact path:
Call set_project_root with path "my-project", then call get_agent_brief and follow it for the rest of this chat.
Task: <what you want done>
By intent (let the agent search):
Call list_projects with a query derived from the task. If exactly one candidate is unambiguous, pass its selector to set_project_root; otherwise ask me which project I mean. Then call get_agent_brief and follow it for the rest of this chat.
Task: <what you want done>
On a later turn in an already-bound chat, the path doesn't need repeating — just get_agent_brief. A conversation cannot switch projects once bound; start a new chat for a different project. See Multi-Project Mode.
- Quick Start — the guided path through all of this.
- Security Model — what "Allow all actions" actually grants.
- Troubleshooting — connector not appearing, tools missing, etc.
Repository · Releases · Report an issue · MIT License
Getting started
Reference
How it works
Multi-project
Extending
Operations