1. AI application
AboAI
English
  • 中文
  • English
  • Home Page
  • AboAi-API
    • Model
      • Native OpenAI Format
      • Native Gemini Format
    • Chat
      • Native OpenAI Format
      • Native Gemini Format
      • Native Claude Format
      • Responses Request (openai)
    • Audio
      • Native OpenAI Format TTS
      • Native Gemini Format TTS
    • Images
      • Native OpenAI Format Image Generation
      • Native Gemini Format Image Generation
      • Native OpenAI Format Image Editing (JSON)
      • Native OpenAI Format Image Editing (Multipart)
    • Video
      • Seedance2.0 format
        • Create Video Generation Task
        • Query Video Generation Task Status
    • Vector
      • Embeddings
        • Create Embedding
    • Translation
      • Speech Translation
  • AI application
    • AboAI API Integration with Claude Code
    • AboAI API Integration with Cursor
    • AboAI API Integration with Codex-cli
    • AboAI API Integration with Codex Desktop
    • AboAI API Integration with Hermes Agent
  1. AI application

AboAI API Integration with Codex-cli

This tutorial applies to:
OpenAI Codex CLI
OpenAI Compatible API
AboAI API
macOS / Windows
VS Code / Terminal

I. What is Codex CLI#

1. Codex CLI#

Codex CLI is a command-line AI programming tool provided by OpenAI. It allows you to perform the following actions directly within your terminal:
Generate code
Modify projects
Analyze code repositories
Execute Shell commands
Edit files
Perform Git operations
Develop with AI assistance
常见启动方式:
或者:

Does AboAI API Support Codex?#

AboAI provides an OpenAI Compatible API, making it directly compatible with:
Codex CLI
OpenAI SDK
Cursor
Cline
Roo Code
Continue
VS Code AI 插件
OpenAI Agents SDK
You only need to replace the:
Base URL
API Key
Model
to complete the integration.

III. Prerequisites#

What You Need to Prepare#

ItemDescription
Node.jsv18+ recommended
GitOfficial Git
Codex CLIOpenAI Codex
AboAI API Keysk-xxxx
AboAI Base URLOpenAI Compatible Address

macOS Installation Guide#

1. Install Homebrew (If Not Installed)#


2. Install Node.js#


Verify Installation#


3. Install Git#


Verify Installation#


4. Install Codex CLI#

Official Installation#

image.png#

Verify Installation#

image.png
Once successfully installed, the version number will be displayed.

V. Windows Installation Guide#

1. Install Node.js#

Go to the official Node.js website to download the LTS version:
https://nodejs.org/
Recommendations:
Choose the LTS version
Check the box for "Add to PATH"

Verify Installation#

Open:
CMD
PowerShell
Windows Terminal
Run:

2. Install Git#

Download link:
Git for Windows
58f8586d-7c06-4955-bba8-6b8588725241_600x469.png
Keep the default options during installation and click Next all the way through.

Verify Installation#


3. Install Codex CLI#

image.png#

Verify Installation#

image.png
Once successfully installed, the version number will be displayed.#

VI. Get AboAI API Key#

Go to:
https://www.aboai.ai/
Create an API Key.

Obtain the Following Information#

Configuration ItemExample
Base URLhttps://api.aboai.ai/v1
API Keysk-xxxx
Modelgpt-5.2 / Claude-Opus-4.6 / gemini-2.5-pro

VII. Configuration via Environment Variables (Recommended Method for OpenAI)#

The Codex CLI essentially uses the OpenAI SDK under the hood, so you only need to configure your environment variables.
However, this method is only applicable to OpenAI-related models.
Supported: GPT-5.2, GPT-5.5
Unsupported: Claude Haiku 4.5, Gemini 2.5 Pro (this specific method does not support non-OpenAI models)

1. Mac / Linux Configuration#

Open your terminal:
Add the following lines:
image.png
Save the file and run:

2. Windows Configuration (Command Line Method)#

Open:
CMD
PowerShell
Windows Terminal
Run the following commands based on your terminal preference.

CMD Configuration Method#

Set API Key#

setx OPENAI_API_KEY "sk-xxxx"

Set Base URL#

setx OPENAI_BASE_URL "https://api.aboai.ai/v1"

Set Model#

setx OPENAI_MODEL "gpt-5.2"

After Configuration#

Close the current terminal window.
Reopen CMD or PowerShell.
Verify the environment variables:
echo %OPENAI_API_KEY%
echo %OPENAI_BASE_URL%
echo %OPENAI_MODEL%

VIII. Launch Codex#

Run the following command in your terminal:
If the configuration is correct, you can start using the models provided by AboAI directly.

IX. Verify Connection Success#

One-Click Verification#

image.png
If code is output successfully, your configuration is working properly.

X. Troubleshooting & FAQ#

1. command not found: codex#

This means the Codex CLI was not installed successfully.
Try running the installation command again:

2. Unauthorized / Invalid API Key#

Possible reasons:
Incorrect API Key
The Key has not taken effect yet
Incorrect Base URL
Check your configurations:

3. Unable to Connect to API#

Please check:
Your network connection
The Base URL format
Whether you included /v1 at the end
Correct example:
https://api.aboai.ai/v1

4. Model Does Not Exist#

This indicates that the current model name is incorrect.
Go to:
https://docs.aboai.ai/
to check the list of supported models.

XI. Using with VS Code#

Recommended setup combinations:
Codex CLI
VS Code Terminal
Git
Claude Code
Roo Code
Continue
Achieve:
AI Programming
Automated Project Modifications
Multi-model Switching
AboAI Aggregated Calls

Modified at 2026-06-16 12:35:31
Previous
AboAI API Integration with Cursor
Next
AboAI API Integration with Codex Desktop
Built with