Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Configure BYOK API keys for OpenAI, Anthropic, Google, Azure, and custom models in Cursor. Triggers on "cursor api key", "cursor openai key", "cursor anthropic key", "own api key cursor", "BYOK cursor", "cursor azure key".
.claude/skills/jeremylongshore-cursor-api-key-management/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 43% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 57% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 49% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 26% | 0% |
Manage any Cursor BYOK/provider credentials as individual, least-privilege secrets with approved routing, ownership, rotation, spending limits, and exposure response.
Create a personal provider key in the approved secret manager, configure it only in the local secure setting, verify a low-cost non-sensitive request, and confirm usage attribution. If it appears in logs, chat, or git, revoke it immediately and replace it; do not attempt to redact history before revocation.
Configure Bring Your Own Key (BYOK) for AI model providers in Cursor. BYOK lets you use your own API keys to bypass Cursor's monthly quota, pay per token directly, and access models not included in Cursor's subscription.
| Provider | Key Format | Models Available | |----------|-----------|-----------------| | OpenAI | sk-proj-... or sk-... | GPT-4o, GPT-4o-mini, o1, o3, GPT-5 | | Anthropic | sk-ant-api03-... | Claude Sonnet, Claude Opus, Claude Haiku | | Google | AIzaSy... | Gemini 2.5 Pro, Gemini Flash | | Azure OpenAI | Azure portal key | Any deployed Azure OpenAI model | | AWS Bedrock | IAM credentials | Claude, Titan, Llama models | | OpenAI-compatible | Varies | Ollama, LM Studio, Together AI, etc. |
Cursor Settings > Models > check Use own API keygpt-4o)Cursor Settings > Models > check Use own API keyCursor Settings > Models > check Use own API keyAzure requires additional configuration beyond a simple API key:
gpt-4o)Cursor Settings > Models:Azure Configuration:
API Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Endpoint: https://your-instance.openai.azure.com
Deployment: your-gpt4o-deployment-name
API Version: 2024-10-21For self-hosted models (Ollama, vLLM) or third-party providers:
Cursor Settings > Models > Add Modelllama-3.1-70bOverride OpenAI Base URLOllama: http://localhost:11434/v1
LM Studio: http://localhost:1234/v1
Together AI: https://api.together.xyz/v1BYOK key used: Cursor model (always):
┌──────────────────────┐ ┌──────────────────────┐
│ Chat (Cmd+L) │ │ Tab Completion │
│ Composer (Cmd+I) │ │ Apply from Chat │
│ Agent Mode │ │ (diff application) │
│ Inline Edit (Cmd+K) │ │ │
└──────────────────────┘ └──────────────────────┘Tab Completion and Apply always use Cursor's proprietary models. You cannot route these through your own API key.
With BYOK, you pay the provider directly. Monitor costs at:
Set monthly spending limits at the provider level:
@Files not @Codebase when you know the location| Model | Input (per 1M tokens) | Output (per 1M tokens) | |-------|----------------------|----------------------| | GPT-4o | $2.50 | $10.00 | | GPT-4o-mini | $0.15 | $0.60 | | Claude Sonnet | $3.00 | $15.00 | | Claude Opus | $15.00 | $75.00 | | o1 | $15.00 | $60.00 |
A typical Composer session generating multi-file code uses 5K-20K tokens.
Cursor stores API keys locally in its settings database:
~/Library/Application Support/Cursor/~/.config/Cursor/%APPDATA%\Cursor\Keys are stored in the local Cursor configuration, not in project files. They do not sync between machines.
Cursor Settings > ModelsFor teams using BYOK:
| Error | Cause | Fix | |-------|-------|-----| | 401 Unauthorized | Invalid or expired API key | Regenerate key at provider | | 429 Rate Limited | Too many requests | Wait, or upgrade provider plan | | 403 Forbidden | Key lacks model access | Enable model access at provider | | Model not appearing | Key not saved or wrong provider | Re-enter key in Cursor Settings | | Azure connection refused | Wrong endpoint or API version | Verify endpoint URL and version | | Slow responses with BYOK | Provider rate limits apply | Check provider dashboard |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-05 | pass→pass | 11,044 | 31,549 | +186% | 1 | 1 | 0% | 2,058 | 2,589 | +26% | 0 | 0 | — |
case-01 | fail→pass | 20,671 | 21,038 | +2% | 1 | 1 | 0% | 2,941 | 3,812 | +30% | 0 | 0 | — |
case-02 | fail→fail | 24,505 | 20,499 | -16% | 1 | 1 | 0% | 4,341 | 5,136 | +18% | 0 | 0 | — |
case-03 | pass→pass | 15,017 | 10,801 | -28% | 1 | 1 | 0% | 1,481 | 2,890 | +95% | 0 | 0 | — |
case-04 | fail→pass | 23,286 | 20,878 | -10% | 1 | 1 | 0% | 1,653 | 2,356 | +43% | 0 | 0 | — |
case-06 | fail→pass | 10,380 | 6,595 | -36% | 1 | 1 | 0% | 1,963 | 3,086 | +57% | 0 | 0 | — |
case-07 | pass→pass | 5,096 | 2,173 | -57% | 1 | 1 | 0% | 941 | 2,201 | +134% | 0 | 0 | — |
case-08 | pass→pass | 11,365 | 9,061 | -20% | 1 | 1 | 0% | 1,940 | 3,490 | +80% | 0 | 0 | — |
case-09 | pass→pass | 10,168 | 3,795 | -63% | 1 | 1 | 0% | 1,855 | 2,598 | +40% | 0 | 0 | — |
case-10 | pass→pass | 12,248 | 5,020 | -59% | 1 | 1 | 0% | 2,151 | 2,810 | +31% | 0 | 0 | — |
case-11 | pass→pass | 11,651 | 6,491 | -44% | 1 | 1 | 0% | 2,032 | 2,836 | +40% | 0 | 0 | — |
case-12 | pass→pass | 5,196 | 3,751 | -28% | 1 | 1 | 0% | 870 | 2,452 | +182% | 0 | 0 | — |
case-13 | pass→pass | 6,632 | 5,088 | -23% | 1 | 1 | 0% | 1,368 | 2,546 | +86% | 0 | 0 | — |
case-14 | pass→pass | 9,729 | 6,282 | -35% | 1 | 1 | 0% | 1,430 | 2,194 | +53% | 0 | 0 | — |
case-15 | pass→pass | 10,381 | 26,880 | +159% | 1 | 1 | 0% | 1,844 | 3,100 | +68% | 0 | 0 | — |
case-16 | pass→pass | 11,580 | 5,136 | -56% | 1 | 1 | 0% | 1,926 | 2,645 | +37% | 0 | 0 | — |
case-17 | fail→pass | 9,866 | 3,324 | -66% | 1 | 1 | 0% | 1,573 | 2,341 | +49% | 0 | 0 | — |
case-18 | pass→pass | 16,494 | 10,099 | -39% | 1 | 1 | 0% | 2,102 | 2,912 | +39% | 0 | 0 | — |
case-19 | pass→pass | 12,819 | 9,712 | -24% | 1 | 1 | 0% | 954 | 2,222 | +133% | 0 | 0 | — |
case-20 | pass→pass | 11,715 | 8,858 | -24% | 1 | 1 | 0% | 2,321 | 3,589 | +55% | 0 | 0 | — |
case-21 | fail→fail | 8,510 | 10,803 | +27% | 1 | 1 | 0% | 1,840 | 4,019 | +118% | 0 | 0 | — |
case-22 | fail→fail | 16,557 | 12,527 | -24% | 1 | 1 | 0% | 3,388 | 4,481 | +32% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +18 percentage points is the difference between those two pass rates over the 22 comparable cases.
The publisher has shipped newer versions since this run, so these numbers describe v1, not the version currently listed.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.