Skip to content

CCSwitch Configuration ​

CCSwitch is suitable to configure MoonNexAI as a service available to Codex, IDE assistant or other OpenAI-compatible client. The rookie suggests that the CCSwitch be preferred because it centrally manages Base URLs, API Key and model names.

Configure Values ​

Configure ItemValue
TypeOpenAI-compatible / Custom Configuration
Base URLhttps://moonnexai.com/v1
API Key<MOONNEXAI_API_KEY>
Chat Path/chat/completions
Models Path/models
Common Chat Modelgpt-5.6-terra, or model ID returned using GET /v1/models

If CCSwitch requests to complete a full chat API address, use:

text
https://moonnexai.com/v1/chat/completions

Install CCSwitch ​

  1. Opens the CCSwitch release page to download the installation package that fits the current system.
  2. Install and start CCSwitch.
  3. Select Codex in the application type, click the top right corner to add the configuration.

Add MoonNexAI Configuration ​

Select the custom configuration in the addition configuration page, and then fill in the link information for MoonNexAI.

Recommended completion:

text
名称:MoonNexAI
Base URL:https://moonnexai.com/v1
API Key:<MOONNEXAI_API_KEY>
Model:gpt-5.6-terra

Save before confirming that the configuration is enabled in CCSwitch, and then starting or restarting Codex.

Get API Key ​

  1. Login https://moonnexai.com.
  2. Enter the API token page of console.
  3. Creates or copys an API Key that can be used in text models.
  4. Paste to the API Key input box for CCSwitch.

Do not write real API Key into project files, screenshots or public documents. The <MOONNEXAI_API_KEY> is used in the document and the example.

Use in Codex ​

If Codex has previously logged in other account or service, it is recommended to exit and then choose to enter API Key.

Paste MoonNexAI API Key by hint.

If the old session is still to be preserved, you can archive it and then revert after the configuration is completed.

Connectivity testing ​

After the configuration is completed, send a short text to test. You can also confirm the availability of API Key and the model by using the command line:

bash
curl https://moonnexai.com/v1/models \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>"

Chat test:

bash
curl https://moonnexai.com/v1/chat/completions \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-terra",
    "messages": [
      {
        "role": "user",
        "content": "回复 ok。"
      }
    ]
  }'

FAQ ​

phenomenaTreatment
401Checks whether API Key is correct and authentication head is Bearer <MOONNEXAI_API_KEY>.
404Checks whether Base URL ends with /v1, and whether the path is duplicated with /v1.
Models Not AvailableUse GET /v1/models query to search for available models and confirm that API Key has corresponding model privileges.
No streaming effect.Checks if the client is opening, and request is moving into stream: true.

More generic settings are available at Client configuration.