OpenAI models in Cursor do not have to depend on Cursor's direct OpenAI contract. CLIProxyAPI can expose the models available through your Codex sign-in as an OpenAI-compatible endpoint, and Cursor can send requests to that endpoint through its custom Base URL setting.
I tested this route and got it working before the cutoff. It gives Cursor users a fallback if OpenAI ends direct model access on the proposed November 12, 2026 date.
OpenAI has not endorsed this setup. CLIProxyAPI is a third-party open-source project, so treat it as a workaround that may break when Cursor, OpenAI, or the proxy changes its authentication and request formats.
What changes on November 12
OpenAI says it intends to wind down the contract that provides its models to Cursor after SpaceX acquired the coding tool. The announcement calls November 12, 2026 a proposed shutoff date.
The decision concerns Cursor's direct model agreement. It does not say that OpenAI will shut down its API, Codex, or every custom endpoint that Cursor can call. I covered the contract change and the responses from Cursor and Anthropic in this earlier breakdown.
The workaround uses a separate route:
- CLIProxyAPI signs in to Codex through OAuth.
- It serves an OpenAI-compatible API on your machine.
- Cloudflare Tunnel gives that local service a public HTTPS URL.
- Cursor sends GPT requests to the tunnel through its OpenAI Base URL override.
1. Install CLIProxyAPI
On macOS, install it with Homebrew:
brew install cliproxyapi
Sign in to Codex:
cliproxyapi --codex-login
The command opens an OpenAI login page. CLIProxyAPI stores the OAuth credential in its authentication directory after you finish the flow.
Open the Homebrew configuration file at $(brew --prefix)/etc/cliproxyapi.conf. Keep the service bound to localhost, leave remote management disabled, and replace the sample API keys with a long random secret:
host: "127.0.0.1"
port: 8317
remote-management:
allow-remote: false
secret-key: ""
auth-dir: "~/.cli-proxy-api"
api-keys:
- "replace-this-with-a-long-random-secret"
Start the service:
brew services start cliproxyapi
Check that the model endpoint responds before adding a tunnel:
curl http://127.0.0.1:8317/v1/models \
-H "Authorization: Bearer replace-this-with-a-long-random-secret"
Linux and Windows users can follow the install options in the CLIProxyAPI quick-start guide. The configuration and Cursor steps stay the same.
2. Give Cursor an HTTPS endpoint
Cursor cannot reach a service bound to 127.0.0.1 from its server-side model path. A Cloudflare Quick Tunnel can expose the local proxy for testing:
brew install cloudflared
cloudflared tunnel --url http://127.0.0.1:8317
Cloudflare prints a random URL such as:
https://random-words.trycloudflare.com
Keep the terminal process running. The URL stops working when the process exits and changes when you start a new Quick Tunnel.
Quick Tunnels are public and Cloudflare describes them as a development and testing feature. Your CLIProxyAPI key protects the model endpoint, so use a strong key and do not share the URL and key together. Use a named Cloudflare Tunnel with your own hostname if you need a stable endpoint.
3. Connect Cursor
Open Cursor Settings > Models > OpenAI, then:
- Enable the OpenAI API key option.
- Paste the API key from your CLIProxyAPI configuration.
- Enable
Override OpenAI Base URL. - Enter your tunnel URL with
/v1at the end, such ashttps://random-words.trycloudflare.com/v1. - Select the GPT model you want to use and run a small test prompt.
Cursor's support forum says custom API keys and Base URL overrides require a Pro plan. Cursor also has a known routing issue where the OpenAI Base URL override can affect built-in models from other providers. Disable the override before switching back to Composer, Claude, Grok, or another Cursor-hosted model if requests start failing.
A cleaner option if you do not need ChatGPT subscription usage
Cursor supports official OpenAI API keys for standard chat models. You can enter an API key from the OpenAI platform and keep the default OpenAI Base URL. OpenAI bills that usage through your API account, separate from a ChatGPT subscription.
That route removes CLIProxyAPI and Cloudflare Tunnel from the chain. Use it when you value stability over reusing the model access attached to your Codex sign-in.
Limits to understand before relying on this
- November 12 remains a proposed cutoff date. OpenAI and Cursor could reach a different agreement.
- CLIProxyAPI is not an OpenAI or Cursor product. An OpenAI employee sharing a project does not make OpenAI support the integration.
- Cursor says custom keys work with standard chat models. Features that depend on Cursor's specialized models can still use Cursor's own infrastructure.
- A proxy can change request behavior, available models, or reasoning settings. Test it on a real task before making it your default.
- Check the terms and account rules that apply to your OpenAI plan. OAuth access through a third-party proxy can change without notice.
The setup gives you a working fallback today. Keep the official API-key route ready if you need a more stable option after November 12.
