Integrate with Codex
Codex is OpenAI's terminal-based AI coding assistant.
I. Prerequisites
Before using Codex, prepare the following.
1. Install Codex
Install or update Node.js (v18.0 or higher).
Run the following command in your terminal to install Codex.
npm install -g @openai/codex
Run the following command to verify the installation.
codex --version
2. Get a LongCat API Key
First, obtain your API Keys from the LongCat Platform, and confirm on the Usage page that your account has sufficient token quota.
The LongCat API platform currently provides the following models:
| Model Name | API Format | Description |
|---|---|---|
| LongCat-2.0-Preview | OpenAI/Anthropic | High-performance agentic model |
| LongCat-Flash-Chat | OpenAI/Anthropic | High-performance general chat model |
II. Configure the LongCat API
1. Model
Edit ~/.codex/config.toml
model_provider = "codex"
model = "LongCat-2.0-Preview"
disable_response_storage = true
web_search = "disabled"
[model_providers.codex]
name = "codex"
base_url = "https://api.longcat.chat/openai/v1"
wire_api = "responses"
requires_openai_auth = true
2. Auth
Edit ~/.codex/auth.json
{
"OPENAI_API_KEY": "<Your LongCat API Key>"
}
Get <Your LongCat API Key> from the LongCat Platform.
III. Using Codex
Once configured, open a new terminal window and run the following command to launch Codex:
codex
If the conversation UI opens normally, you're ready to use Codex + LongCat as your daily driver.