MoleAPIMoleAPI
DocumentationAI Applications

Codex App

Install and configure Mole API as the model provider in the Codex App. Sign in with your API Key and edit config.toml to get started.

Overview

Codex App is the desktop client for Codex, providing the same AI chat and coding assistance capabilities as the Codex extension in VS Code. You can chat, use code completion, and get explanations directly in the standalone app without opening an editor. By configuring Mole API as the model provider, you can use unified key and usage management.

Use Cases

  • You use Codex App and want to access Codex chat and AI capabilities within it.
  • You want to use Mole API as the model access point for Codex to centrally manage usage and keys.

Prerequisites

  • You have obtained your API Key from the Mole API Console (generate and copy it from the Personal Center or Token Management page).

Step 1: Download and Install Codex

  1. Open your browser and visit the Codex official site: https://openai.com/codex.
  2. Follow the instructions on the page to download and install the Codex app.

Download and install from the Codex official site

After installation, launch the Codex app.

Step 2: Sign In with an API Key

  1. In the Codex app, choose the API Key sign-in/authentication method.
  2. Enter the API Key you obtained from the Mole API Console.

Select the API Key method and enter the key in Codex

Edit and save the API Key in Codex

At this point, you have only entered the key. To make Codex actually send requests to Mole API, you also need to specify the model provider in the configuration.

Step 3: Open Settings and Select the Configuration

  1. After signing in, open SettingsSettings.
  2. In Settings, select Configuration to open config.toml.

Open Settings and select Configuration in Codex

Open config.toml in Codex

Step 4: Configure Mole API in config.toml

Add the following content to the opened config.toml:

model_provider = "moleapi"

[model_providers.moleapi]
name = "moleapi"
base_url = "https://api.moleapi.com/v1"
wire_api = "responses"

You can also add model = "the model you want to use from moleapi, for example claude-opus-4-6".

Add the moleapi model provider configuration in config.toml

After saving config.toml, restart Codex for the configuration to take effect.

Step 5: Verify the Configuration

  1. Open Codex again and send a message in the input box (for example, "Hello").
  2. If Codex responds normally, and you can see the request record for the corresponding API Key in the Request Logs of the Mole API Console, then Mole API has been successfully configured as the model provider for Codex.

FAQ

No response or an error when sending messages

  • Make sure model_provider = "moleapi" and [model_providers.moleapi] in config.toml are filled in correctly and saved.
  • Make sure base_url is https://api.moleapi.com/v1. Do not omit /v1 or append extra path segments.
  • Make sure the API Key you entered matches the one in the Mole API Console and has not expired. After changing the configuration, you must restart Codex.

Want to switch models or endpoints

You can manage available models and usage in the Mole API Console. If you need to change the endpoint or provider on the Codex side, update model_provider and the corresponding [model_providers.*] configuration in config.toml, then restart Codex.

References

How is this guide?

Last updated on

Back HomeGateway