跳到主要内容Skip to content
Docs

Codex setup

Configure Codex to use OpenAI as the model provider via 0-0.pro (wire_api = responses).

Scope

Compatible
This setup applies to all Codex clients that read the standard ~/.codex directory, including VS Code Codex extensions/plugins, Codex CLI, and the Codex app.

1) Install or open Codex

Install or open the Codex client you use. Codex reads its shared configuration from ~/.codex.

2) Update ~/.codex/config.toml

Open ~/.codex/config.toml. Below is a minimal example you can copy:

toml
1model = "gpt-5.5"2model_reasoning_effort = "xhigh"3 4# Added OpenAI provider via 0-0.pro (only 6 lines)5model_provider = "OpenAI"6 7[model_providers.OpenAI]8name = "OpenAI"9base_url = "https://api.0-0.pro/v1"10wire_api = "responses"11requires_openai_auth = true12# End added block

If you already have a config, you only need to add the following 6 lines (plus an optional blank line) near the top:

toml
1model_provider = "OpenAI"2 3[model_providers.OpenAI]4name = "OpenAI"5base_url = "https://api.0-0.pro/v1"6wire_api = "responses"7requires_openai_auth = true
Note
Keep your existing model and model_reasoning_effort unchanged.

3) Update ~/.codex/auth.json

Set your 0-0 key as OPENAI_API_KEY:

json
1{2  "OPENAI_API_KEY": "your-api-key"3}

4) Restart or reload Codex

Restart or reload the Codex client you use: reload the VS Code window for VS Code extensions/plugins, restart your Codex CLI session, or reopen the Codex app.

Troubleshooting

Network
If Codex reports stream disconnected before completion: error sending request for url (https://api.0-0.pro/v1/responses), first check the local VPN or proxy. A common cause is a local 60s idle timeout cutting the streaming connection; Codex may retry 5 times, which makes the request look stuck for about 5 minutes.

Why did my past chats disappear?

Codex conversations are associated with the model_provider. All session data is stored locally, but switching providers can make older sessions “invisible”.

To show older sessions under the new provider, find the JSONL files in ~/.codex/sessions and update the model_provider in the first line:

json
1{ "model_provider": "openai", "...": "..." }{ "model_provider": "OpenAI", "...": "..." }

Restart or reload your Codex client after the change to re-load the sessions.

Use mobile ChatGPT to connect to desktop Codex App or CLI

To control Codex running on your computer from ChatGPT on your phone, first keep desktop Codex signed in with the same ChatGPT account you use on mobile. A ChatGPT Free account can also be used for this login step.

  1. On the computer, run Codex login and complete the ChatGPT sign-in flow:

    bash
    1codex login
  2. Update ~/.codex/config.toml to use the ChatGPT login state while sending model requests through 0-0:

    toml
    1model = "gpt-5.5"2model_reasoning_effort = "xhigh"3 4model_provider = "OpenAI"5personality = "pragmatic"6 7[features]8enable_request_compression = true9 10[model_providers.OpenAI]11name = "OpenAI"12base_url = "https://api.0-0.pro/v1"13wire_api = "responses"14requires_openai_auth = true15supports_websockets = false16experimental_bearer_token = "sk-xxx"
  3. If you use Codex CLI, enable remote control once, then keep the remote-control process running:

    bash
    1codex features enable remote_control2codex remote-control
  4. On your phone, install or open ChatGPT, sign in with the same account, find Codex in ChatGPT, and connect it to your computer. If you use the desktop Codex app instead of the CLI, restart the app and use Settings → Connections to allow this computer to be controlled from your phone.