Skip to main content

Documentation Index

Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt

Use this file to discover all available pages before exploring further.

Cursor is an AI code editor built on VS Code. This page covers a known issue when connecting Cursor to a custom gateway using the Override Base URL setting.

BYOK Works, Override Base URL Does Not

Cursor offers two ways to connect to models:
  • BYOK (Bring Your Own Key) — You enter your API key directly in Cursor settings without changing the base URL. This works as expected.
  • Override Base URL — You change the OpenAI base URL to point to a custom gateway or proxy. This has known issues.
The Override Base URL approach has compatibility issues that will cause requests to fail. Read this page before configuring Cursor with a custom gateway.

What Goes Wrong with Override Base URL

When you override the base URL, Cursor still sends requests to the /chat/completions endpoint. But the request body format it sends does not match the Chat Completions spec. The format changes depending on the model you select:
  • OpenAI models — Cursor sends requests in the Responses API format. It uses input instead of messages, sends flat tool definitions, and includes parameters like store, previous_response_id, and truncation that don’t belong in Chat Completions.
  • Anthropic models — Cursor sends requests in the native Anthropic format with Responses API structure on top, while still targeting the /chat/completions endpoint.
  • Gemini models — Similar behavior. Cursor sends Gemini specific formatting that does not follow the Chat Completions spec.
In all cases, the endpoint is /chat/completions but the payload is something else entirely. This is the root cause of failures.

Why a Proxy Does Not Fix This

You might think you can set up a proxy to intercept and transform these requests. This does not work reliably for two reasons:
  1. The request format is unpredictable. Cursor mixes Responses API fields, native model formats, and custom tool types ("type": "custom"). Transforming all of this into valid Chat Completions format requires heavy and fragile patching.
  2. Cursor expects strict Chat Completions responses. Even if you fix the request, Cursor will reject any response that does not exactly match the Chat Completions response format. So you need to transform both directions perfectly.

No Support for Thinking Tokens

The Chat Completions API does not support thinking or reasoning tokens. Even if you get requests flowing through a proxy, the model’s reasoning process cannot be shown in Cursor’s UI.This matters because thinking tokens give visibility into how the model arrives at its answer. Without them, the experience feels like a black box.

Summary

What Works

BYOK — Enter your provider API key directly. Cursor handles formatting and routing correctly on its own.

What Breaks

Override Base URL — Cursor sends the wrong request format to /chat/completions, and no amount of proxying can reliably fix it.
This is a known issue tracked by the Cursor team. See the Cursor Community Forum thread for technical details and discussion.