## Overview

Cursor is an AI-first code editor built on VS Code that provides intelligent code completions, chat, and editing capabilities. By connecting Cursor to ModelStack, you can access 40+ models including Claude, GPT, and Gemini through a single API key.

## Prerequisites

- Cursor installed (download from [cursor.com](https://cursor.com))
- ModelStack API key from your [dashboard](https://modelstack.cc/dashboard/api-keys)

## Configuration

### Step 1: Open Cursor Settings

1. Open Cursor
2. Press `Cmd+,` (Mac) or `Ctrl+,` (Windows/Linux) to open Settings
3. Search for "Models" in the settings search bar

### Step 2: Configure ModelStack

1. Navigate to **Models** → **API Keys**
2. Click **Override OpenAI Base URL**
3. Enter: `https://api.modelstack.cc/v1`
4. Add your ModelStack API key in the API Key field

### Step 3: Select Your Model

In the model dropdown, you can now use any ModelStack-supported model:

- `claude-sonnet-4-6`
- `claude-opus-4-6`
- `gpt-4o`
- `gemini-2.5-pro`
- [View all models](/models/supported-models)

## Usage

Once configured, Cursor will route all AI requests through ModelStack:

- **Chat**: Use `Cmd+L` to open AI chat
- **Inline Edit**: Select code and press `Cmd+K` for AI edits
- **Autocomplete**: AI suggestions appear as you type

## Troubleshooting

**Issue**: "Invalid API key" error

**Solution**: Verify your API key starts with `sk_` and has active credits in your [billing dashboard](https://modelstack.cc/dashboard/billing).

**Issue**: Model not found

**Solution**: Check the [supported models list](/models/supported-models) for correct model names. ModelStack uses standardized names like `claude-sonnet-4-6` instead of provider-specific IDs.

## Next Steps

- [Track usage](/dashboard/analytics) in your ModelStack dashboard
- [Create model stacks]() for automatic fallback routing
- [View pricing](/billing/model-pricing) for all supported models

---
