Claude Code in Cursor
Run the Claude Code extension inside Cursor with a single AI in IDE API key.
Cursor is a VS Code fork, so the official extension installs and behaves the same way — but Cursor ships its own AI features, its own extension registry, and its own settings sync, and each of those changes the troubleshooting.
If you use plain VS Code, read Claude Code in VS Code instead; the configuration block is identical and that page covers the general cases. This page focuses on what is different inside Cursor.
Versions and prerequisites
| Component | Requirement | Notes |
|---|---|---|
| Cursor | a build on VS Code 1.94.0 or later | Cursor → About Cursor shows the VS Code base |
| Claude Code extension | current build from Open VSX or the bundled marketplace | version tracks the bundled CLI |
| AI in IDE key | AWSQ or CCMAX channel | dashboard |
| Anthropic account | not required | the API key replaces the login |
Cursor does not ship claude on your PATH, and neither does the extension. Install the CLI separately only if you want terminal sessions or claude mcp add.
Install the extension
- Direct link: Install for Cursor — Cursor resolves the extension ID, then shows the normal confirmation step.
- Manual:
Cmd+Shift+X/Ctrl+Shift+X, search Claude Code, Install. - If search returns nothing, Cursor's marketplace view may be filtered. Install from the Open VSX Registry — the same build, published for forks that cannot use the Visual Studio Marketplace.
After installing, run Developer: Reload Window if the Spark icon does not appear. The icon only shows when a file is open; having a folder open is not enough.
Create and copy the API key
Open API Keys, create a key, and select AWSQ or CCMAX. Those are the Claude Code channels — a Codex or Gemini key will authenticate against a different endpoint and fail here. You can view or copy the full key again from the API Keys list.
Every snippet below uses YOUR_DASHBOARD_API_KEY as a placeholder for it.
Configuration
1. Connection settings
Create or merge ~/.claude/settings.json (macOS/Linux) or C:/Users/<UserName>/.claude/settings.json (Windows):
1 {2 "$schema": "https://json.schemastore.org/claude-code-settings.json",3 "env": {4 "ANTHROPIC_BASE_URL": "https://api.aiinide.com",5 "ANTHROPIC_AUTH_TOKEN": "YOUR_DASHBOARD_API_KEY",6 "API_TIMEOUT_MS": "600000",7 "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"8 }9 }
ANTHROPIC_BASE_URL stops at the host: Claude Code appends /v1/messages itself. Adding /v1 here sends the request to /v1/v1/messages.
This file is shared by the extension and the CLI, which is why it is the right place for a proxy setup — it survives Cursor updates, profile switches, and window reloads.
2. Turn off the sign-in prompt
The extension is designed around a claude.ai account. Add to Cursor's user settings.json (Cmd+, / Ctrl+,):
1 "claudeCode.disableLoginPrompt": true
Without it, the first panel open offers Sign in and the extension never reaches your base URL.
3. Keep Cursor's own AI out of the way
Cursor's built-in chat and tab completion are separate products and do not share this key. Two practical consequences:
- Two panels, two billing paths. Cursor's own Claude access is billed by Cursor. The Claude Code panel is billed by AI in IDE against your key quota. Use one consistently per task or your usage data will look wrong in both dashboards.
settings.jsoncollisions. Cursor stores extension settings in its own profile; a Cursor profile switch can silently dropclaudeCode.*values. Re-check after switching profiles.
4. Optional: model and shell parity
1 {2 "model": "claude-sonnet-5-5",3 "env": {4 "ANTHROPIC_BASE_URL": "https://api.aiinide.com",5 "ANTHROPIC_AUTH_TOKEN": "YOUR_DASHBOARD_API_KEY"6 }7 }
On macOS, Cursor launched from the Dock inherits the system environment, not your shell profile, so export lines in ~/.zshrc reach the integrated terminal but not the chat panel. The file above is the fix. If you do rely on shell exports, launching with cursor . from a terminal makes them visible.
Verify
First check your key and Claude channel by listing models. This request does not consume quota.
1 curl --globoff -i 'https://api.aiinide.com/v1/models' \2 -H "x-api-key: YOUR_DASHBOARD_API_KEY" \3 -H "anthropic-version: 2023-06-01"
HTTP 200 returns the model list. HTTP 401 means the key is missing, invalid, or expired. HTTP 400 means this key belongs to a different channel. Use an ID from the list in the Messages example below.
- Panel opens without sign-in. Spark icon → panel. If the sign-in screen still appears,
disableLoginPromptis not in user settings. /statusin the prompt box reports the version and model.- Send a short prompt in the editor, then check the key’s usage in the dashboard.
- Test model inference directly with the verified key.
1 curl --globoff 'https://api.aiinide.com/v1/messages' \2 -H "x-api-key: YOUR_DASHBOARD_API_KEY" \3 -H "anthropic-version: 2023-06-01" \4 -H "Content-Type: application/json" \5 -d '{"model":"MODEL_ID_FROM_LIST","messages":[{"role":"user","content":"ping"}],"max_tokens":16}'
- Usage. Usage increments against that key after a successful prompt.
Troubleshooting
Use an exact ID from GET /v1/models. A mistyped claude-* name can resolve to the configured default Claude model and incur charges at that model’s rate.
API Error: 404
Set ANTHROPIC_BASE_URL to https://api.aiinide.com. Adding /v1 sends the request to /v1/v1/messages, which returns 404.
API Error: 400
- Cursor installed the wrong build. A stale extension from a fork-specific registry can lag behind; update it in the Extensions view and reload.
- Malformed
settings.json. Cursor will not tell you the file is broken — it just ignores it. Open it in Cursor; the$schemaline surfaces validation errors inline.
Authentication checks
Use the status from GET /v1/models to diagnose the key. Native POST /v1/messages can return HTTP 200 with an authentication message in content even when the key is missing or invalid.
- Sign-in still happening. If a Claude account was signed in earlier, sign out (
/logout) and setdisableLoginPrompt, then reload. - A different
ANTHROPIC_AUTH_TOKENin the environment. Cursor's environment can come from a shell, a profile, or a launch agent. Checkecho $ANTHROPIC_AUTH_TOKENin Cursor's integrated terminal — if it prints an old value, that one wins. - Key expired or channel changed. A key edited from CCMAX to Codex will fail here. Recreate rather than edit the channel.
Cursor-specific network issues
| Symptom | Cause | Fix |
|---|---|---|
| Panel works, tab completion fails (or vice versa) | only one of the two AI clients has proxy settings | Cursor's HTTP proxy and HTTPS_PROXY are configured separately; set both |
| Extension disappears after a Cursor update | profile reset | reinstall from the Extensions view and re-add claudeCode.* settings |
| Very slow first response, then normal | Cursor's indexer saturating the CPU and the network | wait for indexing to finish, or exclude large directories |
Certificate is not trusted only in Cursor | TLS-inspecting proxy with a CA Cursor does not trust | add NODE_EXTRA_CA_CERTS to env in settings.json, pointing at the proxy root CA |
| Requests hang until timeout in a remote-SSH window | settings live on the remote host | edit ~/.claude/settings.json inside the remote, not locally |
Conflicts with other installed extensions
Cursor installations often carry several AI extensions at once. Two that register chat panels or the same keyboard shortcuts will fight: Cmd+Esc may open Cursor's own chat instead of Claude Code, and the toolbar Spark icon may be hidden. Disable the competing extension temporarily to confirm, then either keep one or rebind the shortcut in the Keyboard Shortcuts editor.
Models and pricing
| Model | Channel | Use it for |
|---|---|---|
claude-opus-5-5 / claude-opus-5.5 | AWSQ, CCMAX | complex refactors, long autonomous runs |
claude-sonnet-5-5 / claude-sonnet-5.5 | AWSQ, CCMAX | the everyday default |
claude-haiku-4-5-20251001 | AWSQ, CCMAX | quick edits, cheap checks |
Opus 5.5 lists at $4 input / $0.20 cache read / $20 output per 1M tokens; quota consumption is 0.8× on AWSQ and 2× on CCMAX. Fast mode, when the upstream uses it, doubles base and cache rates.
- Plans and quota: pricing
- Key management: API Keys
- Endpoint and rate details: Configuration
- Official extension reference: code.claude.com VS Code (Cursor support is documented in the same page)
FAQ
Is the extension officially supported in Cursor? Anthropic publishes it to the Visual Studio Marketplace and Open VSX and documents Cursor as a supported install target. It is third-party software from Anthropic's side: installs go through a marketplace Anthropic does not operate.
Should I install both Cursor's Claude access and this extension? Only if you want both billing paths. For consistent usage numbers, pick one.
Can I share the key with a teammate? Use the quota and expiration fields on the key instead of sharing a personal one, and check Usage per key.