Codex Setup Guide

Use MaiToken in the Codex CLI via CC Switch

Prerequisites

Before you begin, prepare the following:

Add MaiToken in CC Switch

  1. Open CC Switch and select Codex in the app switcher at the top.

  2. Click + in the top-right corner and choose App-specific provider.

  3. Under presets, choose Custom and fill in the following:

    Setting Value
    Name MaiToken
    API Key Your MaiToken API key
    API endpoint / Base URL https://api.maitoken.com/v1
    Model gpt-5.3-codex
    API protocol Responses
    Requires local route mapping Off
  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 turn on "Requires local route mapping." That toggle is for providers that only support Chat Completions.

Launch and Verify

codex

Once inside Codex, send a simple task, for example:

Inspect the current project and describe its main directory structure.

If it returns a result normally, the integration is working.

Switching Models

If your account has other Responses models enabled, you can edit the MaiToken provider and change the model. CC Switch's model input can fetch the available list via /v1/models; you can also check model IDs on the MaiToken model list.

Common choices:

Model Use Case
gpt-5.3-codex Default recommendation, suitable for most coding tasks
gpt-5.3-codex-spark Coding tasks that prioritize response speed
gpt-5.3-codex-official Use when you need an official direct channel

Tip: Whether a model is available depends on your account and channel configuration. Prefer the /v1/models list fetched by CC Switch as the source of truth.

FAQ

Still using the old provider after enabling

Codex does not hot-reload provider configuration. Fully exit Codex, reopen the terminal, and then start codex again.

401 Unauthorized

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

404 or wrong Responses path

Confirm the Base URL is https://api.maitoken.com/v1, the API protocol is Responses, and "Requires local route mapping" is off.

Model unavailable

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

Config files and key safety

CC Switch manages ~/.codex/auth.json and ~/.codex/config.toml. Don't commit these files, your API Key, or screenshots containing the key to a Git repository.

For more on using CC Switch, see its official user manual.