API DocsAPI Docs
LongCat API Platform
  • English
  • 简体中文
LongCat API Platform
  • English
  • 简体中文
  • Quick Start
  • API Docs
  • Claude Code Configuration
  • Kilo Code Configuration
  • OpenCode Configuration
  • OpenClaw Configuration
  • Codex Configuration
  • FAQ
  • Change Log

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 NameAPI FormatDescription
LongCat-2.0-PreviewOpenAI/AnthropicHigh-performance agentic model
LongCat-Flash-ChatOpenAI/AnthropicHigh-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.

Last Updated: 5/15/26, 5:46 PM
Prev
OpenClaw Configuration
Next
FAQ