Configure Codex on Windows: Steps and Connection Details

Configure Codex through the JuheNext client, check your key and model, verify the first request, and understand config.toml, the credential helper, and connection recovery.

This guide uses the Codex connection wizard in the JuheNext Windows client to walk through choosing a key, saving the configuration, and checking the first request. It also explains what the configuration file and credential helper do, and how to restore your previous connection.

It covers the native Windows Codex desktop app. Codex running in WSL or a terminal may use a separate configuration directory. A working desktop connection does not confirm that those environments are configured too.

Before You Start

Have the JuheNext Windows client installed and a key with available credit added to its wallet. The client download is available through JuheNext Agent. If you already have the client, open it.

Quit Codex completely. If you use CC Switch or another connection manager, pause its automatic switching so that both tools do not write to the same configuration. Closing one task tab does not quit the entire Codex app.

In JuheNext, open Application center → Local apps → Codex desktop → Configure and manage Codex. This opens the local connection settings window.

The JuheNext Application center with the Codex desktop panel, three connection steps, and Configure and manage Codex button.
Open Codex desktop in the Application center, then open its local settings. Select any screenshot to enlarge it.

The screenshots show the client with an English Application center. The separate local setup window still displays Chinese in this version. The steps below include its button labels so you can match them to the screen.

Connect Through the Wizard

1. Detect the Installed App

The wizard first checks whether the app is installed. If it finds the app, it normally moves straight to model selection. There is no need to reinstall it.

If it is missing, select “前往 Microsoft Store 安装” (Install from Microsoft Store), follow the store instructions, and check that the publisher is OpenAI. Return to the wizard and select “重新检测安装” (Check installation again). If the Store app will not open, use “商店网页版” (Store website) beside it.

If detection fails after installation, check that you installed the native Windows desktop app, then run detection again. A browser session or a command-line installation inside WSL is not the app this check looks for.

The full local Codex setup window while it reads the existing connection and checks whether the app is installed. The wizard displays Chinese.
The wizard reads the current configuration and checks installation when it opens. This screenshot shows a check in progress, not a completed connection.

2. Choose a Key, Model, and Reasoning Level

Select the key you want to use under “本站卡包 Key” (Site wallet key), then choose the default model.

The dropdown lists models available to that key that the connection workflow recognizes as compatible with Codex. A model that works in ordinary chat may not handle Codex tool calls correctly. If the list is empty, check the key’s status and model access before trying to enter a chat model name yourself.

Keep the full model ID, including any group prefix. The prefix is part of the request identifier. Removing it may select a different model or cause a model-not-found error.

For the first setup, leave the reasoning level at “模型默认” (Model default). Adjust it later using the levels offered for that model; there is no need to raise every setting before testing the connection.

You can save combinations as local schemes. Saving a scheme stores your choices; “确认并连接” (Confirm and connect) changes the Codex connection. Deleting a saved scheme does not disconnect the active connection either.

Step two of the Codex wizard showing the saved scheme, masked wallet key, default model, and model-default reasoning level. Email and balance are hidden.
Select a key and its full model ID. The reasoning level here is Model default. Personal email and balance details are hidden.

3. Review the Settings Before Applying Them

Select “下一步:确认连接” (Next: confirm connection). Check the masked key, full model ID, and reasoning level. Expand “查看配置差异” (View configuration changes) to inspect the changes before applying them.

Step three of the Codex wizard with the masked key, model ID, reasoning level, backup information, configuration changes control, and Confirm and connect button.
Review the connection summary before applying it. The Confirm and connect button has not yet been selected.

Select “确认并连接” (Confirm and connect) and complete the local confirmation. The client creates an encrypted backup of the previous connection before writing the selected settings.

After “连接设置已保存” (Connection settings saved) appears, quit and reopen Codex. This message confirms that the configuration was saved. A model request still needs to be tested.

Verify the Connection With a Small Task

Start a new conversation after restarting, check the selected model, and send a small request such as:

Describe this project’s main folders and how to start it. Only read files for now. Do not change code or run installation commands.

Use this request in an existing test project you are allowed to inspect. If you do not have a project open, start with a simple text question and check that you receive a response.

Check two things:

  • The model responds. The request finishes without an authentication, model-not-found, or protocol error.
  • The tools you need work. In a project you are allowed to inspect, Codex can read files under its own permission rules and describe what it actually read. A text response alone does not establish that file access or other tools work.

An existing conversation may keep its previous model selection. Use a new conversation for the first test so that an old selection does not confuse the result. Seeing the old model in an old conversation is not a reason to delete your configuration or reinstall the app.

Check usage through “查看额度与近期记录” (View balance and recent records) in the client, or the website’s Usage page. Records are grouped by key. If Agent or another app uses the same key, the total includes those requests too. Compare the model and request time when checking the cost of your test.

How the Connection Works

Codex supports custom model providers that connect to compatible model services. The provider identifier, model ID, endpoint, and protocol are separate settings. The wizard uses this configuration mechanism. The fields are documented in the official Codex configuration reference.

The Configuration Selects the Model and Endpoint

The user configuration is normally at ~/.codex/config.toml, typically %USERPROFILE%\.codex\config.toml on Windows. Setting CODEX_HOME changes the user configuration directory. Higher-priority settings, including project-level .codex/config.toml files, can also affect the result. See the official configuration basics for the configuration layers.

The wizard mainly updates connection fields:

  • model: the full model ID sent with requests.
  • model_provider: the provider configuration block to use.
  • base_url: the endpoint that receives model requests.
  • wire_api: the request protocol; the current wizard writes responses.
  • model_reasoning_effort: the chosen reasoning level. Choosing Model default leaves it unspecified.
  • model_catalog_json: the local model catalog file generated by the wizard, which supplies model information for this connection.

The example below shows how a few fields relate. It is not a complete configuration to copy over your file. The wizard supplies the real endpoint, model catalog, and credential helper settings.

# Structure only. Values in angle brackets are placeholders.
model = "<full ID of the selected model>"
model_provider = "juhenext_agent"

[model_providers.juhenext_agent]
name = "JuheNext"
base_url = "<endpoint obtained by the wizard>"
wire_api = "responses"

If you already use a custom provider, the client reuses its identifier when it can safely do so. Your actual model_provider may therefore have another name. Check the configuration changes shown in the wizard.

A reachable endpoint does not establish protocol compatibility. This connection uses the Responses protocol; replacing the address with a /chat/completions endpoint is not enough to make it compatible.

The Credential Helper Supplies the Key

The current client encrypts the key using Windows local encryption and stores it in a client data file. It does not write the raw key into config.toml. The configuration records how to invoke a fixed credential helper. When Codex needs authentication, that helper reads the key and supplies it. External authentication command settings are also covered in the official configuration reference.

The key is still used to authenticate model requests. Encryption changes how it is stored and retrieved locally. It does not remove the need for credentials or keep material sent to the model entirely on your computer.

If you move or uninstall JuheNext while the configuration still points to its old location, the helper may fail to start. Open the client from its current installation and review the connection. Keep the raw key out of public screenshots and error reports.

Model Requests and Local Tools Have Separate Roles

During a task, Codex assembles context and sends a model request to the gateway. The gateway checks the key and forwards the request to the selected model. Codex then handles the answer or tool calls returned by the model.

File reads and command execution still happen through Codex in its own environment, under its permission and sandbox settings. Changing the model connection does not change those permissions, and the wizard does not loosen them. See the official security and permissions documentation for those boundaries.

Model calls through this connection consume the selected key’s credit. They do not add a subscription to your ChatGPT account or establish that every feature requiring an official account or cloud service will work through the same endpoint.

Switch Services or Restore the Previous Connection

The current client includes connection management. While JuheNext is running, including in the system tray, it maintains the connection fields you confirmed. If another tool changes those fields, JuheNext may try to restore them. Repeated conflicts cause it to pause maintenance and show a message in settings.

Before switching back to CC Switch or manual configuration, select “停止本站托管” (Stop site-managed connection), then let the other tool take over. Closing the JuheNext window may only minimize it to the tray, so that alone does not stop connection management.

Stopping management handles two cases:

  • If the connection is still managed by JuheNext, the client restores the connection fields from before this setup.
  • If another program has already taken over, the client keeps that program’s current configuration instead of overwriting it with an older backup.

The “连接管理与用量” (Connection management and usage) section also provides “恢复原连接” (Restore previous connection). These actions do not delete saved schemes, projects, or conversations. Review the on-screen details before restoring.

The client preserves existing login, MCP, permission, and conversation files, but it does not migrate conversation history. The visibility of some older conversations may still depend on the Codex version and previous provider identifier. If your project files remain in their original folder, reopen the project before trying to recover it by deleting configuration files.

Troubleshoot Common Problems

Settings Save, but Sending a Message Fails

Make sure you quit and reopened Codex, then check the selected model in a new conversation. Use the error message to narrow the next check to key status, balance, model access, or network connectivity. Loading a model list in JuheNext and completing a model request in Codex are separate operations.

For authentication errors, check the key first. For model-not-found errors, check the full ID and model access. For timeouts, check the network and endpoint. For rate or credit limits, use the service’s error details and usage records instead of repeatedly retrying.

A Model Is Missing or Reasoning Options Differ

Select “刷新配置与模型” (Refresh configuration and models), then check which key is selected. The wizard lists models according to that key’s permissions and the compatibility catalog. Reasoning options also depend on the model. A listing in the website catalog does not mean every key can call that model.

Another Program Changed the Connection

To keep using JuheNext, pause automatic switching in the other tool. Select “核对并重新接入” (Review and reconnect), inspect the changes, and confirm. To use the other tool, stop JuheNext connection management first. Avoid having both tools maintain the same connection automatically.

The Configuration Cannot Be Parsed or the Active Profile Needs Review

Keep the current file and error details. Invalid TOML, an active profile, or a structure that cannot be edited safely can cause the wizard to stop. Do not delete the entire .codex directory to get past the check. Identify the active profile and file, then address the specific issue.

This guide follows the JuheNext Windows client v1.2.7 code and wizard as of November 25, 2026. Images are actual client screenshots. Available models and settings depend on your key and installed version.

Related Reading