Cursor IDE setup
Override OpenAI Base URL in Cursor to reach Claude 3.7 Sonnet, DeepSeek R1, and GPT-4o through CallAI.
1. Interaction modes & model picks
| Scenario | Shortcut | Model | Why |
|---|---|---|---|
| Composer agent | Cmd + I / Ctrl + I | claude-3-7-sonnet | Precise multi-file refactors |
| Inline Diff edit | Cmd + K / Ctrl + K | claude-3-7-sonnet / gpt-4o | Fast in-place patches |
| Sidebar Q&A | Cmd + L / Ctrl + L | deepseek-chat / gpt-4o-mini | Low-cost walkthroughs |
2. Setup steps
Step 1: Open model settings
Press Cmd + , (Mac) or Ctrl + , (Windows), then open Models.
Step 2: Enable Override and fill fields
Check Override OpenAI Base URL and enter:
OpenAI Base URL: https://api.callaiapi.com/v1
API Key: sk-live-your-callai-key
Step 3: Add custom models
Under Model Names, add and enable:
claude-3-7-sonnetdeepseek-r1gpt-4odeepseek-chatclaude-3-5-sonnet
⚠️Troubleshooting 403 / 401
401 usually means the key is wrong or missing the sk-live- prefix. 403 often means a local proxy TUN mode is hijacking DNS — set api.callaiapi.com to Direct.
3. Production .cursorrules template
# Place at project root as .cursorrules 1. Language: Strict TypeScript — explicit types, no any. 2. Architecture: React function components + Hooks; Tailwind for UI; separate business logic from presentation. 3. Error handling: wrap network/async I/O in try/catch; no unhandled Promise rejections. 4. Tests: add Vitest/Jest cases under __tests__ for new core logic.
Seeing network or status-code errors?
Use the HTTP status checker to isolate auth vs network issues.