Skip to content

Get your first ZhiFlo reply in Codex

Allow about 15 minutes | Requires Codex and CC Switch | Finished when Codex returns OK

This guide takes you through one real connection. An installed app, a completed import, or a saved settings screen does not prove the full path works; the final OK response does.

  • A key created on the portal’s API Keys page is what this guide calls a Token. Treat it as the password for access to the ZhiFlo API.
  • A group determines which set of services the Token can use. Choose a group currently available to your account.
  • A provider is the connection saved in CC Switch with the service URL, Token, and model settings. This guide uses ZhiFlo as the provider.
  • A model ID is the complete identifier sent in a request. Copy the complete value from your account’s list; it may differ from the display name, and a value from another guide may not work for you.
  • Sign in to the ZhiFlo API portal.
  • Install Codex from the official Codex project and confirm that codex --version prints version information.
  • Install and open CC Switch. Expand Assets on the download page and choose the installer that matches your operating system and processor.

A terminal is the window where you enter commands. On Windows, search for PowerShell from Start. On macOS, press Command-Space and search for Terminal. On Linux, open Terminal from the application menu.

A version number confirms that Codex is installed. The connection is complete only after Codex returns a reply in the final step.

  1. Create one Token for this device and Codex.
  2. Open the CC Switch import from that Token row.
  3. Confirm that ZhiFlo is active inside CC Switch.
  4. Restart Codex and see OK.

Open API Keys in the ZhiFlo API portal.

Locate API Keys in the ZhiFlo API portal sidebar

The highlighted navigation item opens Token management. You should see your API key list, which may be empty.

Select Create API Key.

Locate the Create API Key button on the API Keys page

The highlighted control is Create API Key.

Enter a name that identifies the device and client, such as “Laptop Codex.” Select an available group, then choose a finite expiration and quota before creating the key.

Treat the Token like a password. Create one for this device and Codex, avoid unlimited expiration or quota, and never put the complete value in chat, screenshots, or a public repository.

Copy the new Token into a trusted password manager. Back in the list, you should see the name you just created.

Open the action menu on the new API key row and select CC Switch.

The Import to CC Switch dialog should open. If it does not, make sure you used the action on the API key row rather than another control on the page.

In Import to CC Switch, select Codex, then select a model available to your account.

Use a model from your own list instead of copying a model name from another guide. The dialog should now show Codex and the complete model ID.

Select Open CC Switch. If the browser asks permission to open an external application, allow it to open your installed CC Switch app.

Start this action only from the signed-in ZhiFlo API portal on a trusted device. Do not copy, forward, or construct the app deep link by hand.

In the CC Switch import preview, confirm that the app is Codex, the provider is ZhiFlo, the API endpoint is https://api.zhiflo.com/v1, and the model ID matches your selection.

Confirm the ZhiFlo Codex configuration in the Chinese CC Switch import preview

The screenshot uses the Chinese interface. The Token and dynamic model ID are redacted; verify your own values instead of copying a model from the image.

Select 导入, which means Import, after checking the values. The ZhiFlo card should appear in the Codex provider list. If it does not, reopen the preview and complete the final import action.

After a normal import, ZhiFlo should already be the active provider. Check the Codex provider list: CC Switch 3.17.0 uses a blue border and pale-blue shading for the current provider. Other versions may show Active, Currently enabled, or an equivalent state.

ZhiFlo highlighted as the current Codex provider in the Chinese CC Switch interface

The blue ZhiFlo card is the current Codex provider. If your ZhiFlo card does not have the current state, select it to finish switching.

Exit every running Codex session and close old terminal windows. Open a new terminal and start Codex again. A process that was already running will not read the newly imported provider.

If Codex still shows the previous provider, return to CC Switch, confirm that ZhiFlo is active, then exit and reopen Codex once more.

Start Codex in an empty folder that does not contain important files, then send:

Do not modify any files. Reply with OK only.

Codex returning OK to the minimal test in a terminal

This is a real terminal result captured after the same CC Switch import. The screenshot uses the Chinese equivalent of the prompt above; OK is the same success signal.

When Codex returns OK, the setup is complete. You have confirmed all four moving parts together: the Token works, the model works, CC Switch is using ZhiFlo, and Codex can send a real request.

For a 401, model error, or missing reply, follow the matching symptom in Troubleshoot connection problems. Avoid creating multiple Tokens or trying random model names.

Next: Monitor usage and set Token limits.