跳到主要内容Skip to content
Docs

Codex setup

Configure Codex to use OpenAI as the model provider via 0-0.pro (wire_api = responses), with a one-file setup for signed-in accounts or a two-file setup without an OpenAI login.

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. Choose the one-file setup if Codex is already signed in to your OpenAI account; choose the two-file setup if it is not.

1) Install or open Codex

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

2A) Update ~/.codex/config.toml (OpenAI account already signed in)

First sign in to your OpenAI account:

bash
1codex login

Set ~/.codex/config.toml to the following:

toml
1model = "gpt-5.6-sol"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"
Note
Use this one-file setup when Codex is already signed in to your OpenAI account. Replace sk-xxx with your 0-0 API key. This is the only file you need to update for this setup.

2B) Without an OpenAI login: update config.toml and auth.json

If Codex is not signed in to an OpenAI account, use this two-file setup. First add the 0-0 provider to ~/.codex/config.toml:

toml
1model = "gpt-5.6-sol"2model_reasoning_effort = "xhigh"3 4model_provider = "OpenAI"5 6[model_providers.OpenAI]7name = "OpenAI"8base_url = "https://api.0-0.pro/v1"9wire_api = "responses"10requires_openai_auth = true

Then create or update ~/.codex/auth.json with your 0-0 API key:

json
1{2  "OPENAI_API_KEY": "your-api-key"3}
Note
This two-file setup is for users who have not signed in to an OpenAI account. Keep the API key only in your local auth.json file.

3) 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.

Restore previous chats

  1. Close the Codex app, Codex CLI, and the Codex extension in VS Code.
  2. Run the command for your system.

    Windows PowerShell:

    powershell
    1py -c "import sqlite3,pathlib; db=sqlite3.connect(pathlib.Path.home()/'.codex'/'state_5.sqlite'); db.execute('UPDATE threads SET model_provider=?',('OpenAI',)); db.commit()"

    macOS / Linux:

    bash
    1sqlite3 "$HOME/.codex/state_5.sqlite" "UPDATE threads SET model_provider = 'OpenAI';"
  3. Reopen Codex. If you use Codex CLI, run:

    bash
    1codex resume --all

Use mobile ChatGPT to connect to desktop Codex App or CLI

After completing the config above, use these steps to control Codex running on your computer from ChatGPT on your phone. 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. If you use Codex CLI, enable remote control once, then keep the remote-control process running:

    bash
    1codex features enable remote_control2codex remote-control
  3. 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.