Integrations
Cursor with Plan2API: custom models through your own key
Cursor lets Premium ($30 a month) and higher plans add an OpenAI API key and override the OpenAI base URL. Set the key to your Plan2API p2a_ key and the URL to https://api.plan2api.com/v1, then add models such as claude/claude-opus-5-5 to use your Claude, ChatGPT, Google AI or Kimi plan in Chat. Tab keeps using Cursor's own models.
- Cursor plan needed
- Premium $30/
mo or higher - Works in
- Chat and Agent, not Tab
- Base URL
- api.plan2api.com/
v1 - OpenAI exit from Cursor
- Proposed Nov 12, 2026
Updated
Settings at a glance
Every value in the table below goes into Cursor Settings > Models.
| Setting | Value |
|---|---|
| Where | Cursor Settings > Models |
| OpenAI API Key | Your p2a_ |
| Override OpenAI Base URL | https:// |
| Custom models | claude/ |
| More models | gemini/ |
| Cursor plan | Premium, Super, Ultra, Teams, Enterprise |
| Legacy plans | Pro, Pro+ and Ultra |
| Works in | Chat and Agent; Tab stays on Cursor |
| Cursor charge | Individual: none; Teams, Enterprise: $0.25/ |
Set up Cursor with Plan2API
- Sign in at
plan2api.com/connectwith a Google account, connect a Claude Pro or Max, ChatGPT, Google AI Pro or Ultra, or Kimi Code plan, and create ap2a_API key. - Test your new key from a terminal with the
curlcommand below to confirm your subscription is connected and responding before you change any Cursor settings. - Open
Cursor Settings > Modelsin your editor. - Paste your
p2a_key into theOpenAI API Keyfield and save it. - Turn on
Override OpenAI Base URLand enterhttps://api.plan2api.com/v1. - Add each model you want to use by its exact Plan2API model id, such as
claude/claude-opus-5-5,openai/gpt-6.1-sol,gemini/gemini-4-argon-highorkimi/k3. - Pick the custom model you added in the Chat model dropdown and send a test message.
curl https://api.plan2api.com/v1/chat/completions \
-H "Authorization: Bearer p2a_your_key" \
-H "Content-Type: application/json" \
-d '{"model": "claude/claude-opus-5-5", "messages": [{"role": "user", "content": "Reply with OK"}]}'Pick your models
The table below lists the model ids you can add to Cursor for Claude Pro and Max subscriptions, ChatGPT plans through Codex, Google AI Pro and Ultra through Antigravity, and Kimi memberships through Kimi Code.
Type the model ids into Cursor exactly as GET /v1/models returns them, including the provider prefix like claude/, openai/, gemini/ or kimi/, because Cursor sends the exact name you enter to POST /v1/chat/completions unchanged. A model only answers if you have connected a subscription for that provider in Plan2API, and one p2a_ key can route across all of your connected subscriptions at once.
| Model id | Subscription it uses | Context window |
|---|---|---|
| claude/ | Claude Pro or Max | 1M tokens |
| claude/ | Claude Pro or Max | 1M tokens |
| openai/ | ChatGPT plan through Codex | 500K default in Codex |
| gemini/ | Google AI Pro or Ultra | 1,048,576 tokens |
| kimi/ | Kimi Code | 1,048,576 tokens |
What works and what doesn't
- Chat works over the
POST /v1/chat/completionsendpoint. - Agent mode can fail on custom endpoints: on June 29, 2026 Cursor staff confirmed that Agent requests can include an
ApplyPatchcustom tool in the Responses API shape instead of the Chat Completions shape, which OpenAI's API rejects withmissing_required_parameterfortools[n].custom, so Agent edits can fail on endpoints that don't accept that tool shape. - Tab completion never uses your own API key and always keeps using Cursor's own models.
- The
Override OpenAI Base URLtoggle is global for all OpenAI-family requests rather than per model, so turn it off before switching back to Cursor's built-in OpenAI models (Cursor forum guide, September 13, 2026). - Cursor routes all own-key requests through its backend servers for final prompt building, which means your custom OpenAI compatible API endpoint must be reachable from the public internet, as
https://api.plan2api.com/v1is. - Cursor Plus at $8 a month cannot use own API keys at all, Teams and Enterprise plans pay a Cursor Token Rate of $0.25 per 1M tokens on own-key requests to eligible models, and zero data retention does not apply when you use your own keys.
Troubleshooting
Use the table below to match HTTP status codes and error codes from POST /v1/chat/completions to their fixes.
If the curl test works in your terminal but Cursor fails, check that Override OpenAI Base URL is turned on and that the custom model name in Cursor matches the Plan2API model id character for character.
| Error | Cause | Fix |
|---|---|---|
| 401 invalid_ | Key missing, mistyped or revoked | Paste the full p2a_ |
| 403 no_ | No plan connected for that model's provider | Connect the plan at plan2api.com/ |
| 400 model_ | Model name differs from the Plan2API id | Copy the id from GET / |
| 400 unsupported_ | JSON mode sent to a Claude model | Use a GPT, Gemini or Kimi model for JSON |
| Agent requests fail | ApplyPatch sent as a custom tool | Edit with a Cursor model, override off |
OpenAI models after November 12
OpenAI announced on August 28, 2026 that it will wind down its contract supplying OpenAI models to Cursor, with a proposed shutoff date of November 12, 2026, and noted that Cursor may end access sooner. If you are weighing whether to stay in the editor or move your workflow elsewhere, see our comparison of Cursor vs Claude Code or look at a full Cursor alternative.
OpenAI's help page lists three ways to keep using GPT models in Cursor after the shutoff: putting your own OpenAI API key into Cursor's local Chat and Agent, installing the Codex IDE extension, or routing through an AI gateway such as Amazon Bedrock, Azure or another OpenAI-compatible gateway. With Plan2API, the gateway route lets you use your existing ChatGPT plan in Cursor through live Codex model ids like openai/gpt-6.1-sol, openai/gpt-6-astra and openai/gpt-6-luna without per-token API billing.
Use the AI subscriptions you already pay for as one OpenAI-compatible API key.
- Free: 1 subscription, 50 requests a day, no card
- Pro: $12 a month
FAQ
Can I use a custom model in Cursor?
Yes, if you are on Cursor Premium ($30 a month), Super ($100 a month), Ultra ($200 a month), a legacy Pro, Pro+ or Ultra plan, or Teams or Enterprise (which pay Cursor's Token Rate of $0.25 per 1M tokens on own-key requests to eligible models). Open Cursor Settings > Models, paste your key into OpenAI API Key, turn on Override OpenAI Base URL, and add the custom model name so it matches the endpoint's model id. Custom models work in Chat and Agent, while Tab keeps using Cursor's own models.
Does Cursor BYOK work on the Plus plan?
No, Cursor BYOK does not work on the Plus plan. Cursor Plus costs $8 a month and includes neither third-party models nor support for your own API keys. Cursor Premium at $30 a month is the cheapest current individual plan that lets you add your own keys, and own-key requests on individual plans are not charged against your included usage.
Does Cursor send my requests through its servers?
Yes. Cursor routes every request through its own backend servers for final prompt building, so any custom endpoint you set in Override OpenAI Base URL must be reachable from the public internet. Your API key is sent to Cursor's backend with each request rather than stored on Cursor's servers, and zero data retention does not apply to own-key requests.
Can I use my Claude subscription in Cursor?
Cursor's native Anthropic key field only accepts a per-token Anthropic API key, not a Claude Pro or Max login. By using Plan2API's OpenAI-compatible endpoint (https://api.plan2api.com/v1) and turning on Override OpenAI Base URL, your connected Claude Pro or Max subscription answers in Cursor Chat under model ids like claude/claude-opus-5-5, claude/claude-sonnet-5 and claude/claude-haiku-4-5.
Will GPT models keep working in Cursor?
OpenAI's help page lists ways to keep using GPT models in Cursor after the proposed November 12, 2026 shutoff: your own OpenAI API key in Cursor's local Chat and Agent, or an AI gateway such as Amazon Bedrock, Azure or another OpenAI-compatible gateway. You can also use OpenAI's Codex IDE extension.
Sources
- Cursor: bring your own API keycursor.com
- Cursor pricingcursor.com
- Cursor forum: custom OpenAI-compatible APIforum.cursor.com
- OpenAI Help: using OpenAI models in Cursorhelp.openai.com
- OpenAI: our decision on Cursoropenai.com
- Cursor forum: ApplyPatch custom tool with base URL overrideforum.cursor.com
- Cursor Token Ratecursor.com