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

  1. Open Cursor Settings (Cmd+, on macOS, Ctrl+, on Windows/Linux)
  2. Click Models in the left sidebar
  3. In the "OpenAI API Key" field, enter your ModelBridge key
  4. Enable "Override OpenAI Base URL" and enter:
https://api.modelbridge.dev/cursor/v1
  1. 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
  1. 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

IssueSolution
"Auth error" or 401Check your API key is correct and hasn't been revoked
Model not respondingEnsure the model name matches exactly (case-sensitive)
Agent mode not workingEnsure your base URL and API key are set correctly -- Agent mode supports custom endpoints
Timeout errorsLarger models like Claude Opus take longer; this is normal
Inline edits not workingMake sure the base URL ends with /cursor/v1, not /v1/chat/completions

Was this page helpful?