BYOK Works, Override Base URL Only Works with Databricks
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 only works with the Databricks model provider as described below.
What Works
Databricks Provider with Override Base URL — Create a Databricks model provider account with the
/cursor/v1 base URL and add your TrueFoundry API key in Cursor settings.What Breaks
Other Providers with Override Base URL — OpenAI, Anthropic, and Gemini providers send incompatible request formats to
/chat/completions, and no amount of proxying can reliably fix it.Prerequisites
Before integrating Cursor with TrueFoundry, ensure you have:- TrueFoundry Account: Create a TrueFoundry account and follow the instructions in our Gateway Quick Start Guide
- Databricks Provider Account: Create a Databricks model provider account in TrueFoundry with the base URL set to:
- Models Configured: Add the models you want to use to the Databricks provider account on the TrueFoundry platform
- Cursor Installed: Install Cursor on your machine
Integrate TrueFoundry with Cursor
Add API Key and Base URL
Scroll to the API Keys section at the bottom and configure:
- OpenAI API Key: Enter your TrueFoundry API key (Personal Access Token)
- OpenAI Base URL: Enter
{GATEWAY_BASE_URL}/cursor/v1
Important Precautions
- Model name must match Model ID — When adding custom models in Cursor, use the exact same name as the Model ID configured on the TrueFoundry platform.
- Avoid reserved words in provider account name — Do not use words like
GPT,Claude, orGeminiin your Databricks model provider account name. Cursor uses these keywords internally to determine request formatting, which can cause unexpected behavior. - Cursor-only integration — This integration works exclusively within the Cursor IDE. It will not work on the TrueFoundry Playground or any other interface.
What Goes Wrong with Other Providers
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
inputinstead ofmessages, sends flat tool definitions, and includes parameters likestore,previous_response_id, andtruncationthat 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/completionsendpoint. - 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 with non-Databricks providers.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:- 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. - 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.
The underlying issue with non-Databricks providers is tracked by the Cursor team. See the Cursor Community Forum thread for technical details and discussion.