From cursor-pack
Guides BYOK API key setup in Cursor for OpenAI, Anthropic, Google Gemini, Azure, AWS Bedrock, and custom endpoints. Use when configuring AI models beyond Cursor's quota.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin cursor-packThis skill is limited to using the following tools:
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.
Guides AI model selection and configuration in Cursor for Chat, Composer, and Agent modes with task recommendations and BYOK setup for OpenAI, Anthropic.
Provides expert guidance for Vercel AI Gateway configuration including model routing, provider failover, cost tracking, and multi-provider management via unified API.
Provides guidance on Azure OpenAI Service 2025 models like GPT-5 series, GPT-4.1, o3/o4-mini reasoning, Sora video generation, image/audio models, and Azure CLI deployment.
Share bugs, ideas, or general feedback.
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 |
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-21
For 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/v1
BYOK 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 |