cursor-api-key-management

0
0
Source

Manage API keys and authentication in Cursor. Triggers on "cursor api key", "cursor openai key", "cursor anthropic key", "own api key cursor". Use when working with APIs or building integrations. Trigger with phrases like "cursor api key management", "cursor management", "cursor".

Install

mkdir -p .claude/skills/cursor-api-key-management && curl -L -o skill.zip "https://mcp.directory/api/skills/download/7622" && unzip -o skill.zip -d .claude/skills/cursor-api-key-management && rm skill.zip

Installs to .claude/skills/cursor-api-key-management

About this skill

Cursor API Key Management

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.

Supported Providers

ProviderKey FormatModels Available
OpenAIsk-proj-... or sk-...GPT-4o, GPT-4o-mini, o1, o3, GPT-5
Anthropicsk-ant-api03-...Claude Sonnet, Claude Opus, Claude Haiku
GoogleAIzaSy...Gemini 2.5 Pro, Gemini Flash
Azure OpenAIAzure portal keyAny deployed Azure OpenAI model
AWS BedrockIAM credentialsClaude, Titan, Llama models
OpenAI-compatibleVariesOllama, LM Studio, Together AI, etc.

Configuration Steps

OpenAI

  1. Go to platform.openai.com/api-keys
  2. Create a new API key (project-scoped recommended)
  3. In Cursor: Cursor Settings > Models > check Use own API key
  4. Paste key in the OpenAI API Key field
  5. Select model from dropdown (e.g., gpt-4o)

Anthropic

  1. Go to console.anthropic.com/settings/keys
  2. Create a new API key
  3. In Cursor: Cursor Settings > Models > check Use own API key
  4. Paste key in the Anthropic API Key field
  5. Select Claude model from dropdown

Google (Gemini)

  1. Go to aistudio.google.com/apikey
  2. Create API key
  3. In Cursor: Cursor Settings > Models > check Use own API key
  4. Paste key in the Google API Key field

Azure OpenAI

Azure requires additional configuration beyond a simple API key:

  1. In Azure Portal: create an Azure OpenAI resource
  2. Deploy your desired model (e.g., gpt-4o)
  3. Note the Endpoint URL and API Key from the resource
  4. In Cursor: 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

Custom OpenAI-Compatible Endpoints

For self-hosted models (Ollama, vLLM) or third-party providers:

  1. Cursor Settings > Models > Add Model
  2. Model name: e.g., llama-3.1-70b
  3. Check Override OpenAI Base URL
  4. Enter base URL:
Ollama:        http://localhost:11434/v1
LM Studio:    http://localhost:1234/v1
Together AI:  https://api.together.xyz/v1
  1. Enter API key if required by the provider
  2. The model appears in the Chat/Composer model dropdown

What BYOK Covers (and What It Does Not)

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.

Cost Management

Monitoring Usage

With BYOK, you pay the provider directly. Monitor costs at:

Setting Spending Limits

Set monthly spending limits at the provider level:

  • OpenAI: Settings > Limits > Set monthly budget
  • Anthropic: Settings > Limits > Set spending limit
  • Azure: Create budget alerts in Azure Cost Management

Cost-Saving Strategies

  1. Use Auto mode: Cursor selects cheaper models for simple tasks
  2. Default to Sonnet/GPT-4o: Reserve Opus/o1 for hard problems
  3. Shorter context: Use @Files not @Codebase when you know the location
  4. Fewer round-trips: Write detailed prompts to reduce back-and-forth

Approximate Token Costs (as of early 2026)

ModelInput (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.

Security Best Practices

Key Storage

Cursor stores API keys locally in its settings database:

  • macOS: ~/Library/Application Support/Cursor/
  • Linux: ~/.config/Cursor/
  • Windows: %APPDATA%\Cursor\

Keys are stored in the local Cursor configuration, not in project files. They do not sync between machines.

Rotation

  1. Generate a new key at the provider
  2. Update the key in Cursor Settings > Models
  3. Revoke the old key at the provider
  4. Verify Chat/Composer work with the new key

Team Key Management

For teams using BYOK:

  • Individual keys: Each developer uses their own key. Simplest setup, hardest to audit.
  • Shared project key: Create a project-scoped key at the provider. Share via secure channel. Track usage per project.
  • Azure gateway: Route all requests through a central Azure OpenAI deployment. Full audit logging, spending controls, model governance.

Troubleshooting

ErrorCauseFix
401 UnauthorizedInvalid or expired API keyRegenerate key at provider
429 Rate LimitedToo many requestsWait, or upgrade provider plan
403 ForbiddenKey lacks model accessEnable model access at provider
Model not appearingKey not saved or wrong providerRe-enter key in Cursor Settings
Azure connection refusedWrong endpoint or API versionVerify endpoint URL and version
Slow responses with BYOKProvider rate limits applyCheck provider dashboard

Enterprise Considerations

  • Compliance: BYOK routes requests directly to the provider, bypassing Cursor's infrastructure. Verify this meets your data governance requirements.
  • Azure private endpoints: Enterprise Azure deployments can use private endpoints for network-level isolation
  • Key rotation policy: Implement quarterly key rotation as standard practice
  • SSO + BYOK: Team admins can configure shared BYOK keys via the admin dashboard (Enterprise plan)

Resources

svg-icon-generator

jeremylongshore

Svg Icon Generator - Auto-activating skill for Visual Content. Triggers on: svg icon generator, svg icon generator Part of the Visual Content skill category.

7824

automating-mobile-app-testing

jeremylongshore

This skill enables automated testing of mobile applications on iOS and Android platforms using frameworks like Appium, Detox, XCUITest, and Espresso. It generates end-to-end tests, sets up page object models, and handles platform-specific elements. Use this skill when the user requests mobile app testing, test automation for iOS or Android, or needs assistance with setting up device farms and simulators. The skill is triggered by terms like "mobile testing", "appium", "detox", "xcuitest", "espresso", "android test", "ios test".

13615

d2-diagram-creator

jeremylongshore

D2 Diagram Creator - Auto-activating skill for Visual Content. Triggers on: d2 diagram creator, d2 diagram creator Part of the Visual Content skill category.

3114

performing-penetration-testing

jeremylongshore

This skill enables automated penetration testing of web applications. It uses the penetration-tester plugin to identify vulnerabilities, including OWASP Top 10 threats, and suggests exploitation techniques. Use this skill when the user requests a "penetration test", "pentest", "vulnerability assessment", or asks to "exploit" a web application. It provides comprehensive reporting on identified security flaws.

4311

performing-security-audits

jeremylongshore

This skill allows Claude to conduct comprehensive security audits of code, infrastructure, and configurations. It leverages various tools within the security-pro-pack plugin, including vulnerability scanning, compliance checking, cryptography review, and infrastructure security analysis. Use this skill when a user requests a "security audit," "vulnerability assessment," "compliance review," or any task involving identifying and mitigating security risks. It helps to ensure code and systems adhere to security best practices and compliance standards.

109

designing-database-schemas

jeremylongshore

Design and visualize efficient database schemas, normalize data, map relationships, and generate ERD diagrams and SQL statements.

1128

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

9521,094

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

846846

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

571699

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

548492

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

673466

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

514280

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.