CU

cursor-api-key-management

Manage and configure your own API keys for AI model providers in Cursor to bypass quotas and use specific model versions.

Install

mkdir -p .claude/skills/cursor-api-key-management && curl -L -o skill.zip "https://agentskills.codes/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

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Configure BYOK API keys for OpenAI, Anthropic, Google, Azure, and custom
72 charsno explicit “when” trigger
Beginner

Key capabilities

  • Configure API keys for OpenAI models like GPT-4o and GPT-5.
  • Set up API keys for Anthropic models such as Claude Sonnet and Claude Opus.
  • Integrate Google Gemini models using API keys.
  • Configure Azure OpenAI resources with endpoint URLs and API keys.
  • Connect AWS Bedrock models using IAM credentials.
  • Add custom OpenAI-compatible endpoints for models like Ollama and LM Studio.

How it works

This skill guides the user to input their API keys and configuration details into Cursor's settings for various AI model providers. Cursor then routes requests through these personal keys, bypassing its own quota system.

Inputs & outputs

You give it
API keys, endpoint URLs, deployment names, and IAM credentials for various AI model providers
You get back
Configured Cursor IDE to use personal API keys for specified AI models

When to use cursor-api-key-management

  • Configure OpenAI API keys for specific project-scoped model access
  • Setup Anthropic API credentials for Claude model usage
  • Connect Azure OpenAI or AWS Bedrock model endpoints to Cursor
  • Integrate local models via OpenAI-compatible endpoints

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

When not to use it

  • When using Cursor's Tab Completion feature.
  • When using Cursor's Apply from Chat feature.

Limitations

  • Tab Completion always uses Cursor's proprietary models.
  • Apply from Chat always uses Cursor's proprietary models.

How it compares

This workflow allows direct payment to AI model providers and access to models not included in Cursor's subscription, unlike relying solely on Cursor's default model access.

Compared to similar skills

cursor-api-key-management side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
cursor-api-key-management (this skill)125dReviewBeginner
1password272moReviewIntermediate
security-compliance197moReviewAdvanced
information-security-manager-iso27001117moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

1password

openclaw

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.

2799

security-compliance

davila7

Guides security professionals in implementing defense-in-depth security architectures, achieving compliance with industry frameworks (SOC2, ISO27001, GDPR, HIPAA), conducting threat modeling and risk assessments, managing security operations and incident response, and embedding security throughout the SDLC.

1981

information-security-manager-iso27001

davila7

Senior Information Security Manager specializing in ISO 27001 and ISO 27002 implementation for HealthTech and MedTech companies. Provides ISMS implementation, cybersecurity risk assessment, security controls management, and compliance oversight. Use for ISMS design, security risk assessments, control implementation, and ISO 27001 certification activities.

1169

cursor-sso-integration

jeremylongshore

Configure SSO and enterprise authentication in Cursor. Triggers on "cursor sso", "cursor saml", "cursor oauth", "enterprise cursor auth", "cursor okta". Use when working with cursor sso integration functionality. Trigger with phrases like "cursor sso integration", "cursor integration", "cursor".

433

springboot-security

affaan-m

Spring Security best practices for authn/authz, validation, CSRF, secrets, headers, rate limiting, and dependency security in Java Spring Boot services.

529

django-security

affaan-m

Django security best practices, authentication, authorization, CSRF protection, SQL injection prevention, XSS prevention, and secure deployment configurations.

522

Search skills

Search the agent skills registry