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.

Cursor settings for Plan2API
SettingValue
WhereCursor Settings > Models
OpenAI API KeyYour p2a_ key
Override OpenAI Base URLhttps://api.plan2api.com/v1
Custom modelsclaude/claude-opus-5-5, openai/gpt-6.1-sol
More modelsgemini/gemini-4-argon-high, kimi/k3
Cursor planPremium, Super, Ultra, Teams, Enterprise
Legacy plansPro, Pro+ and Ultra
Works inChat and Agent; Tab stays on Cursor
Cursor chargeIndividual: none; Teams, Enterprise: $0.25/1M on eligible models

Set up Cursor with Plan2API

  1. Sign in at plan2api.com/connect with a Google account, connect a Claude Pro or Max, ChatGPT, Google AI Pro or Ultra, or Kimi Code plan, and create a p2a_ API key.
  2. Test your new key from a terminal with the curl command below to confirm your subscription is connected and responding before you change any Cursor settings.
  3. Open Cursor Settings > Models in your editor.
  4. Paste your p2a_ key into the OpenAI API Key field and save it.
  5. Turn on Override OpenAI Base URL and enter https://api.plan2api.com/v1.
  6. 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-high or kimi/k3.
  7. Pick the custom model you added in the Chat model dropdown and send a test message.
curl
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.

Plan2API model ids for Cursor
Model idSubscription it usesContext window
claude/claude-opus-5-5Claude Pro or Max1M tokens
claude/claude-sonnet-5Claude Pro or Max1M tokens
openai/gpt-6.1-solChatGPT plan through Codex500K default in Codex
gemini/gemini-4-argon-highGoogle AI Pro or Ultra1,048,576 tokens
kimi/k3Kimi Code1,048,576 tokens

What works and what doesn't

  • Chat works over the POST /v1/chat/completions endpoint.
  • Agent mode can fail on custom endpoints: on June 29, 2026 Cursor staff confirmed that Agent requests can include an ApplyPatch custom tool in the Responses API shape instead of the Chat Completions shape, which OpenAI's API rejects with missing_required_parameter for tools[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 URL toggle 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/v1 is.
  • 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.

Common errors
ErrorCauseFix
401 invalid_api_keyKey missing, mistyped or revokedPaste the full p2a_ key into the OpenAI key
403 no_credentialsNo plan connected for that model's providerConnect the plan at plan2api.com/connect
400 model_not_foundModel name differs from the Plan2API idCopy the id from GET /v1/models
400 unsupported_parameterJSON mode sent to a Claude modelUse a GPT, Gemini or Kimi model for JSON
Agent requests failApplyPatch sent as a custom toolEdit 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

  1. Cursor: bring your own API keycursor.com
  2. Cursor pricingcursor.com
  3. Cursor forum: custom OpenAI-compatible APIforum.cursor.com
  4. OpenAI Help: using OpenAI models in Cursorhelp.openai.com
  5. OpenAI: our decision on Cursoropenai.com
  6. Cursor forum: ApplyPatch custom tool with base URL overrideforum.cursor.com
  7. Cursor Token Ratecursor.com