Skip to Content
AI GatewayCursor IDE

Cursor IDE

Cursor’s Override OpenAI Base URL must target the Cursor adapter, not the unified /gateway/v1 root.

SettingValue
OpenAI API Keyeis_… (org platform key)
Override OpenAI Base URLhttps://production-api.exemplar.dev/gateway/cursor
Custom modelExact allowlisted id, e.g. openai/gpt-4o-mini, anthropic/claude-sonnet-4-6

Create the key under Tokens and API keys. Enable providers under AI Gateway → Management → Providers.

Cursor is not OpenAI passthrough and not Unified /gateway/v1. See Choose your surface if you are unsure which base to use.

Do not set the override to /gateway/v1 or /gateway/openai/v1. Cursor still posts to /chat/completions, but the body is often Responses-shaped (input, flat tools, previous_response_id, …). Plain Chat Completions backends reject that. The adapter at /gateway/cursor normalizes the request, calls the gateway Responses (or Chat) path, and returns Chat Completions JSON/SSE Cursor expects.

Why /gateway/v1 fails

When Override Base URL is set, Cursor calls {base}/chat/completions. Payload shape depends on the selected model family:

Model family in CursorTypical bodyExpected response
OpenAI-styleResponses API fields (input, …) on /chat/completionsStrict Chat Completions
Anthropic-styleNative Anthropic + Responses-like fields on the same pathStrict Chat Completions
Gemini-styleProvider-specific fields, not Chat CompletionsStrict Chat Completions

/gateway/cursor (and /gateway/cursor/v1/chat/completions) exists for that mismatch. Telemetry is tagged route_mode=cursor.

Setup

  1. Cursor Settings → Models.
  2. Enable Override OpenAI Base URL and paste https://<api-host>/gateway/cursor (no trailing slash; do not append /v1 yourself—the adapter serves both /chat/completions and /v1/chat/completions).
  3. Paste your org eis_* key as the OpenAI API key.
  4. Add custom models using the exact gateway model ids from Management / catalog.

Supported modes today: Ask and Plan. Agent/Composer may still use Cursor’s own backend. Prefer HTTP/1.1 in Cursor network settings if you see TLS or connection errors.

curl -sS -X POST https://production-api.exemplar.dev/gateway/cursor/chat/completions \ -H "Authorization: Bearer $EXEMPLAR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"openai/gpt-4o-mini","input":[{"role":"user","content":"hi"}]}'

Precautions

  • Model id must match an enabled allowlisted provider/model. Mismatched custom names fail at the gateway.
  • Thinking / reasoning UI — Chat Completions responses do not surface full thinking-token streams the way native provider UIs might; treat that as a Cursor + Chat Completions limitation.
  • Rate limits apply when a policy is effective — see Rate limits.

Model path vs action path

NeedSurface
Route Cursor chat through Exemplar modelsThis page (/gateway/cursor)
Allow / deny shell, MCP, prompts, file readsRelay Connect (Cursor hook bridge)
Org MCP toolsTools & MCP → Connect

Hooks are independent of the model base URL—you can use Relay without /gateway/cursor, or both together.

Last updated on