Cursor sends a hybrid OpenAI-style payload for some agent flows. ModRouter has a dedicated /cursor integration that converts those requests correctly.

Endpoint

Cursor usually needs a URL that is reachable from the Cursor app, so local-only addresses may not work in every setup.

Setup

  1. Open Cursor Settings.
  2. Go to Models.
  3. Enter a ModRouter virtual key in the OpenAI API Key field.
  4. Enable Override OpenAI Base URL.
  5. Set the base URL to your ModRouter /cursor endpoint.
  6. Add custom models using ModRouter model IDs.
Examples:

MCP

Cursor can also connect to ModRouter’s MCP gateway:
Use the same virtual key header strategy you use for inference: Authorization: Bearer <key>, x-bf-vk, or X-Api-Key.
Use /cursor for Cursor’s OpenAI-compatible override. Do not document Cursor as a plain /openai client unless you intentionally want to bypass ModRouter’s Cursor-specific request conversion.