Cursor
Cursor supports custom OpenAI-compatible endpoints for its AI features. ModelBridge provides a dedicated /cursor/v1 endpoint optimized for Cursor's request format.
Setup
- Open Cursor Settings (
Cmd+,on macOS,Ctrl+,on Windows/Linux) - Click Models in the left sidebar
- In the "OpenAI API Key" field, enter your ModelBridge key
- Enable "Override OpenAI Base URL" and enter:
https://api.modelbridge.dev/cursor/v1
- Click "+ Add Model" and add the models you want to use:
Base URL: https://api.modelbridge.dev/cursor/v1
API Key: mb_live_your_key_here
Models to add:
- claude-sonnet-4-6- Open a new chat (
Cmd+L), select your model from the dropdown, and test it
Why /cursor/v1?
ModelBridge exposes two endpoint formats:
/v1-- Standard OpenAI-compatible format. Works with most tools./cursor/v1-- Cursor-specific format handling. Translates Cursor's request quirks automatically.
Use /cursor/v1 for the best Cursor experience. The standard /v1 endpoint also works but may have edge cases with certain Cursor features.
Important notes
- The "OpenAI API Key" label is misleading. It's used for whatever base URL you set -- your ModelBridge key goes here, even for Claude models.
- The "Anthropic API Key" field is separate. It's only for direct Anthropic connections. Don't use it with ModelBridge.
- One base URL for all custom models. Cursor uses a single global base URL -- you can't set per-model URLs.
- Model names must match exactly. Use the IDs from the list above (case-sensitive).
- Don't append
/chat/completions. Cursor adds this automatically. Your URL should end with/cursor/v1.
Troubleshooting
| Issue | Solution |
|---|---|
| "Auth error" or 401 | Check your API key is correct and hasn't been revoked |
| Model not responding | Ensure the model name matches exactly (case-sensitive) |
| Agent mode not working | Ensure your base URL and API key are set correctly -- Agent mode supports custom endpoints |
| Timeout errors | Larger models like Claude Opus take longer; this is normal |
| Inline edits not working | Make sure the base URL ends with /cursor/v1, not /v1/chat/completions |