How to Use Claude API in Cursor IDE — 2-Minute Setup [2026]
Connect Claude Sonnet 4.6, Opus 4.7, and Haiku 4.5 to Cursor IDE via LLMsRelay. Step-by-step guide, no Anthropic account. Works with Chat, Composer, and Agent.
LLMsRelay is an independently operated API gateway. It is not affiliated with or endorsed by Anthropic, PBC. Product and model names are used only to describe compatibility.
Provider type: OpenAI-compatible (custom). Base URL: https://api.llmsrelay.com/v1. API key: sk-cs4-*. Model id: claude-sonnet-4.6 (or opus / haiku). Setup time: ~30 seconds.
Quick Answer
To use Claude API in Cursor IDE: open Cursor Settings → Models, enable OpenAI API Key and OpenAI Base URL, set the base URL to https://api.llmsrelay.com/v1, paste your LLMsRelay API key, and add claude-sonnet-4.6 to the model list. Setup takes under 2 minutes. No Anthropic account, no phone verification — just a Cursor Pro subscription and a LLMsRelay key.
Why LLMsRelay for Cursor?
Cursor's built-in Claude access requires Anthropic's API key, which has account requirements, no Russian/CIS payment options, and limited per-key controls. LLMsRelay solves all three: instant signup, payment in RUB/crypto/cards, and per-key credit limits.
- Same Claude models (Sonnet 4.6, Opus 4.7, Haiku 4.5) — same per-token rates as Anthropic direct
- OpenAI-compatible endpoint — Cursor sees it as a generic OpenAI proxy
- Pay with Mir card, SBP, USDT, BTC, or international Visa/Mastercard
- Per-key credit limits — set $20 cap on a key for a junior dev, no surprise bills
Required Plan
Custom API access in Cursor requires a paid Pro plan or higher.
Exact Fields in Cursor
- OpenAI API Key: your API key from the LLMsRelay dashboard (starts with
sk-) - OpenAI Base URL:
https://api.llmsrelay.com/v1(must include/v1) - Verify: click "Verify" — Cursor will list all available models
Recommended Setup
- Open Cursor settings (
Cmd/Ctrl + ,) - Go to Models
- Turn on OpenAI API Key
- Paste your API key from llmsrelay.com dashboard
- Turn on OpenAI Base URL
- Set it to
https://api.llmsrelay.com/v1 - Click Verify — should show "OpenAI key works"
- Open Composer (
Cmd/Ctrl + I), pick a Claude model from the dropdown, send a test prompt
/v1 at the end.Recommended Model IDs
claude-opus-4.7— most powerful, best for refactors and architectureclaude-sonnet-4.6— best value for daily coding (default)claude-haiku-4.5— fastest, cheapest, ideal for batch edits
Troubleshooting
"Invalid API Key" error: Verify the key starts with sk- and the base URL ends with /v1. Cursor caches keys aggressively — restart Cursor after pasting.
"Model not found": Make sure the model ID exactly matches (e.g. claude-sonnet-4.6, not claude-sonnet-4.5). Add the model in Cursor's "Add Model" field.
Slow responses: Switch to Haiku 4.5 for fast inline edits, or check your network. LLMsRelay adds <100ms overhead vs Anthropic direct.
Windows-specific notes
The 8-step setup above is identical on Windows, macOS, and Linux. A few Windows extras:
- Installer: download Cursor from cursor.sh. The MSI puts
cursoron PATH and registers%APPDATA%\Cursorfor settings. - Hotkey: Ctrl+, for Settings, Ctrl+I for Composer, Ctrl+L for Chat.
- Restart Cursor fully after pasting the key — close all windows, then end any
Cursor.exein Task Manager. Cursor caches OpenAI credentials in memory. - Corporate proxy:
setx HTTPS_PROXY "http://proxy.company:8080"in PowerShell, then reopen Cursor. - SmartScreen / antivirus blocking outbound calls — whitelist
api.llmsrelay.com. - WSL projects: Cursor on Windows talks to LLMsRelay directly — env vars inside WSL do not affect Cursor's HTTP calls. Configure the key in Cursor Settings (the GUI), not in
~/.bashrc.