Codex Configuration Guide

Use MaiToken in Codex CLI through CC Switch

Prerequisites

Before you begin, prepare the following:

Add MaiToken in CC Switch

  1. Open CC Switch and select Codex from the application switcher at the top.

  2. Click + in the upper-right corner and select App-Specific Provider.

  3. Select Custom from the presets and enter the following:

    Configuration Item Value
    Name MaiToken
    API Key Your MaiToken API key
    API Endpoint / Base URL https://api.maitoken.net/v1
    Model gpt-5.3-codex
    API Protocol Responses
    Local Route Mapping Required Disabled
  4. Click Add, then click Enable on the MaiToken provider card.

  5. Close any running Codex and terminal windows, then reopen the terminal for the configuration to take effect.

Note: MaiToken natively supports POST /v1/responses, so do not enable "Local Route Mapping Required." This option is intended for providers that support only Chat Completions.

Launch and Verify

codex

After entering Codex, send a simple task, for example:

Inspect the current project and describe its main directory structure.

If a result is returned successfully, the integration is working.

Switch Models

If your account has access to other Responses models, you can edit the MaiToken provider and change the model. The model input field in CC Switch supports retrieving the available list through /v1/models; you can also visit the MaiToken Model List to view model IDs.

Common choices:

Model Use Case
gpt-5.3-codex Recommended by default; suitable for most coding tasks
gpt-5.3-codex-spark Coding tasks that prioritize response speed
gpt-5.3-codex-official Use when an official direct connection is required

Tip: Model availability depends on your account and channel configuration. Use the /v1/models list retrieved by CC Switch as the primary reference.

Troubleshooting

The Old Provider Is Still Used After Enabling MaiToken

Codex does not hot-reload provider configurations. Exit Codex completely, reopen the terminal, and then start codex again.

401 Unauthorized

  1. Check whether the API Key in CC Switch is complete.
  2. Confirm that the key is valid in the MaiToken Console.
  3. Confirm that your account has sufficient balance.

404 or Incorrect Responses Path

Confirm that the Base URL is https://api.maitoken.net/v1, the API protocol is Responses, and "Local Route Mapping Required" is disabled.

Model Unavailable

In CC Switch, click "Fetch Models" next to the model field, or call GET https://api.maitoken.net/v1/models to check which models are available for the current key.

Configuration File and Key Security

CC Switch manages ~/.codex/auth.json and ~/.codex/config.toml. Do not commit these files, your API Key, or screenshots containing keys to a Git repository.

For more instructions on using CC Switch, refer to its official user manual.