This is also a compilation of my own usage experiences, not a direct translation of official documentation. If you are using Cline or Cursor and want to integrate Codex’s models, you might find this solution useful.
Project Address
GitHub: https://github.com/violet27chen/codexProapi
What It Does
In simple terms, it exposes Codex models (such as gpt-5.5, gpt-5.4, gpt-5.4-mini, gpt-5.3-codex, gpt-image-2, etc.) through OpenAI-compatible APIs, allowing you to use them directly within Cline, Cursor, or any client that supports OpenAI interfaces.
It supports two main functionalities:
- Text Dialogue:
/v1/chat/completions - Image Generation:
/v1/images/generations(for models like gpt-image-2)
If you are already using Cline or Cursor for coding, this tool enables you to call Codex’s models without waiting for the official APIs to be released.
Core Features
Here are a few features I find particularly practical:
1) Multi-account Polling and Failover
You can configure multiple Codex accounts, and requests will be automatically polled among them. If one account fails, the proxy will automatically try with the next one without the need for manual switching. This is very helpful for stability, especially when you have multiple accounts.
2) Independent Account Proxy
Each account can be associated with a separate proxy (supporting HTTP, HTTPS, and SOCKS). All requests and token refreshes for that account will go through this dedicated proxy. This is useful if you have multiple servers or if certain accounts need to use specific routes.
3) Automatic Token Refresh
The backend automatically refreshes the OAuth access_token at regular intervals (minimum interval of 5 minutes). Once the refresh is successful, accounts that were previously marked as “unavailable” will automatically resume polling.
Once set up, you basically don’t need to worry about it further.
4) Batch Import
You can import Refresh Tokens in batches by pasting or uploading .txt files. The system will automatically exchange them for access_tokens and save the accounts.
This is much faster than importing them one by one if you have multiple accounts.
5) Interactive Dashboard
There is a web management interface (default: http://localhost:1455/) where you can:
- Manage accounts and proxy configurations
- View real-time requests and logs
- Check model availability
- View usage statistics
The interface is available in both Chinese and English.
How to Use
Method 1: Desktop Version (Recommended)
- Download the Windows installation package from GitHub Releases: https://github.com/violet27chen/codexProapi/releases
- Install and run the software; the configuration page will open directly within the software window.
- The local service will stop automatically when you close the software. The desktop version is currently only available for Windows; macOS and Linux require using the command line.
Method 2: Command Line
Node.js 18+ is required:
npm install -g codex-proapi
codex-proapi
After installation, open http://localhost:1455/.
Configuration in Cline / Cursor
| Configuration Item | Value |
|---|---|
| Base URL | http://localhost:1455/v1 |
| Model | gpt-5.4, gpt-5.5, or other supported models |
| API Key | You can fill in anything (no validation; authentication is based on the account you configured) |
Steps to configure:
- Add Codex accounts on the
http://localhost:1455/page (using OAuth login, pasting JSON data, or batch import). - If needed, associate each account with a specific proxy URL.
- Set the Base URL and model in the client.
- Use the service as usual; the proxy will handle polling, retries, and token refreshes automatically.
Image Generation
Image generation is also supported through the /v1/images/generations interface:
curl -X POST http://localhost:1455/v1/images/generations \
-H "Content-Type: application/json" \
-d '{"model":"gpt-image-2","prompt":"a cat","n":1,"size":"1024x1024"}'
Supported models include gpt-image-2 (default), gpt-image-1.5, gpt-image-1, and gpt-image-1-mini.
Troubleshooting
Here are some common issues and solutions:
- Region not supported during login: Make sure the proxy is also used for the login page; try switching to a different server.
- Request fails with “fetch failed”: Check if the account is activated and if the server can access chatgpt.com.
- 400 Error: “Missing required parameter: tool…”: Disable the
function calling /toolsin the client; the proxy will automatically settool_choice: none.
Who This Is For
- People using Cline or Cursor for coding who want to integrate Codex models.
- Those with multiple Codex accounts who need to implement polling and failover.
- Those who need to configure different proxy routes for different accounts.
- Those looking for a locally controllable API intermediary layer.
Summary
If you are using Cline or Cursor and want to utilize Codex’s models, this tool is ready to use out of the box. Features like multi-account polling, independent proxies, and automatic token refreshes save a lot of manual effort.
The project is open-source under the MIT license. If you have any issues, you can report them on GitHub Issues: https://github.com/violet27chen/codexProapi/issues