Cursor / Windsurf
Cursor and Windsurf are AI-native code editors that support custom API endpoints. Both can route LLM requests through Candela for full observability.
Cursor
Section titled “Cursor”OpenAI-Compatible Models (Gemini, Ollama)
Section titled “OpenAI-Compatible Models (Gemini, Ollama)”- Open Settings → Models
- Add a new OpenAI API model:
| Setting | Value |
|---|---|
| API Base | http://localhost:1234/v1 |
| API Key | candela |
| Model | gemini-3.5-pro (or any model from /v1/models) |
Claude Models
Section titled “Claude Models”Cursor has native Anthropic support. To route Claude through Candela:
- Open Settings → Models → Anthropic
- Set API Base URL to:
http://localhost:8181/proxy/anthropic-direct
- Enter your Anthropic API key
Or use the Vertex AI route (no API key needed):
http://localhost:8181/proxy/anthropic-vertexEnvironment Variable (Alternative)
Section titled “Environment Variable (Alternative)”# Route all Cursor Anthropic requests through Candelaexport ANTHROPIC_BASE_URL="http://localhost:8181/proxy/anthropic-vertex"Windsurf
Section titled “Windsurf”Windsurf supports custom OpenAI-compatible endpoints:
- Open Settings → AI → Custom Model
- Configure:
| Setting | Value |
|---|---|
| Base URL | http://localhost:1234/v1 |
| API Key | candela |
| Model | gemini-3.5-pro |
What Gets Traced
Section titled “What Gets Traced”Both editors generate many LLM calls during a single coding session — inline completions, chat, code actions, and multi-file edits. Candela captures all of them:
| Feature | Traced |
|---|---|
| Chat / inline completions | ✅ |
| Multi-file edits | ✅ |
| Code explanations | ✅ |
| Terminal commands | ✅ |
Check http://localhost:8181/_local/ to see per-request token counts, cost, and latency across your entire coding session.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
| Model dropdown empty | Cursor can’t reach /v1/models | Verify candela start is running |
| ”Invalid API key” | Cursor validates keys before use | Use candela as the key — it passes validation |
| High cost for completions | Many small requests add up | Check traces to identify chatty features |
| Traces not appearing | Wrong base URL | Use :1234 for OpenAI-compat, :8181/proxy/* for provider-specific |