codex-cursor-proxy
v0.1.2
Published
Use your ChatGPT Plus/Pro subscription to access Codex models in third-party clients like Cursor
Downloads
32
Maintainers
Readme
codex-cursor-proxy
A small CLI proxy that lets you use your ChatGPT Plus/Pro subscription to access Codex models in third-party clients like Cursor. It's hacky but it works.
Prerequisites
- Bun >= 1.0
- Codex CLI authenticated with your ChatGPT account (
codexmust have been run at least once so~/.codex/auth.jsonexists)
Quick start
bunx codex-cursor-proxyThis starts a local proxy on port 3000 and opens a public tunnel via localtunnel. On startup it prints:
OpenAI Base URL for Cursor: https://<subdomain>.loca.lt
API Key: Anything you like!Cursor setup
- Open Cursor settings
- Under Models > OpenAI, set:
- Base URL to the tunnel URL printed at startup
- API Key to any non-empty string (e.g.
x)
- Select a model name that matches what Codex supports (e.g.
gpt-5.4)
How it works
Cursor ──POST /chat/completions──> Proxy ──POST Responses API──> chatgpt.com
Cursor <──Chat Completions SSE──── Proxy <──Responses API SSE──── chatgpt.com- Cursor sends requests in the OpenAI Responses API format
- The proxy sanitizes the payload (extracts system message into
instructions, strips unsupported params, forcesstream: trueandstore: false) - Forwards to
chatgpt.com/backend-api/codex/responsesusing your Codex access token from~/.codex/auth.json - Translates the streaming Responses API events (
response.output_text.delta, etc.) into Chat Completions SSE chunks (data: {"choices":[...]}) - Streams back to Cursor with
data: [DONE]sentinel
Configuration
The proxy stores a persistent tunnel subdomain in ~/.codex/cursor-proxy/config.json so the URL stays the same across restarts.
License
MIT
