Cursor IDE -> Cursor backend -> GoModel -> upstream model provider
Cursor subscription and GoModel are separate
A paid Cursor subscription can be used alongside GoModel. It provides the Cursor editor and features that require Cursor’s infrastructure, and Cursor currently requires a paid plan for Agent and Edit with BYOK models. It does not provide upstream model credit to GoModel:
When GoModel is selected, you therefore pay for the Cursor plan and for model
usage on the provider account behind GoModel. Teams and Enterprise customers
also pay Cursor’s token rate on eligible third-party BYOK requests.
What goes through GoModel
The OpenAI base URL override is global for OpenAI-family model routing. Disable
it before using a Cursor-hosted model that should not go through GoModel.
Before you start
- Deploy GoModel at a public HTTPS URL, such as
https://gomodel.example.com. - Use a paid Cursor plan for Agent and Edit with the GoModel BYOK route.
- Configure at least one upstream provider and model in GoModel.
- Create a dedicated GoModel managed API key for Cursor at API Keys -> Create API Key in the dashboard.
- Install a current Cursor release. Custom-endpoint fixes, including image routing, shipped during June 2026.
Cursor sends your API key to its backend with each request. Cursor states
that the key is encrypted in transit and not persisted, but its Zero Data
Retention policy does not apply to BYOK requests. Use a dedicated managed
GoModel key rather than
GOMODEL_MASTER_KEY.1. Run GoModel
This example starts GoModel with an OpenAI upstream. In production, terminate TLS at a reverse proxy or load balancer and follow the production deployment guide.GOMODEL_MASTER_KEY administers GoModel. Do not enter it in Cursor after you
have created a dedicated managed key.
2. Verify the public endpoint
Run these checks from a machine that is not on the private network hosting GoModel. Replacesk_gom_... with the dedicated key created for Cursor.
ok.
3. Choose a Cursor model name
The simplest setup uses an OpenAI-style model name that Cursor accepts, such asgpt-4.1-mini. Cursor forwards that model name unchanged to GoModel.
GoModel normally lists provider-qualified selectors such as
openai/gpt-4.1-mini. Create a virtual model whose
short source name matches Cursor and whose target is the exact
provider-qualified selector:
claude- or gemini- because
Cursor routes those through its provider-specific BYOK paths instead of the
OpenAI base URL override.
4. Configure Cursor
1
Open the Models settings
In Cursor, open Cursor Settings -> Models.
2
Set the OpenAI API key
Find OpenAI API Key, enable it, and enter the dedicated GoModel managed
key.
3
Override the OpenAI base URL
Enable Override OpenAI Base URL and enter
https://gomodel.example.com/v1. Keep /v1; do not append
/chat/completions or /responses.4
Save the settings
Click Save. If your Cursor build shows Verify, use it as well.
5
Select the model
Open a new chat and select
gpt-4.1-mini. If you created a custom virtual
model, use Add Model in the Models settings and enter the exact source
name first.5. Validate Cursor traffic
Start with a text-only prompt:POST /v1/chat/completions and used the expected model.
Troubleshooting
Cursor cannot reach localhost
Use a public HTTPS URL. Cursor’s backend must be able to reach GoModel. A local
address, private IP, or self-signed TLS certificate will not work reliably.
401 Unauthorized
Make sure the value in OpenAI API Key is the dedicated GoModel key and that
the key has not been revoked. Do not enter an upstream provider key in Cursor.
Model not found
Cursor forwards the selected model name to GoModel. Copy the exact selector
from /v1/models, or create a virtual model whose source matches the name
shown in Cursor.
Cursor-hosted models stop working
The OpenAI override can affect other OpenAI-family and some Cursor-hosted model routes. Disable the custom OpenAI key and base URL before switching back to those models, then start a new chat.Agent or tool calls fail while text works
Upgrade Cursor, retry with a standard OpenAI chat model, and inspect GoModel’s audit log for the upstream response. Custom endpoint support has had release-specific payload bugs, especially around custom tools on newer GPT models.Images do not reach GoModel
Upgrade Cursor. Cursor fixed the custom-base-URL image routing issue in release3.9.16 in June 2026. Older releases can validate the GoModel key against
OpenAI directly and fail before the request reaches GoModel.
Security and privacy
This setup does not create a direct private connection from the Cursor desktop app to GoModel. Cursor’s backend remains in the request path for prompt construction and context retrieval. It also does not make Cursor Tab or other Cursor-hosted features use GoModel. For an internet-facing GoModel deployment:- use TLS with a publicly trusted certificate
- give Cursor its own managed key rather than the master key
- restrict the key’s user path and model access where appropriate
- protect the admin dashboard separately from the public API
- rotate the Cursor key if it is pasted or logged anywhere unintended
References
- Cursor: Bring your own API key
- Cursor: Models and pricing
- Cursor: Cursor token rate
- Cursor staff: Public HTTPS is required for custom endpoints
- Cursor staff: How model routing works with the OpenAI override
- Cursor staff: Subscription models are not a general inference API
- Cursor staff: Paid plan requirement for BYOK Agent and Edit
- Cursor staff: Custom endpoint image-routing fix
- Cursor: Custom endpoint Agent payload discussion
Investigated on August 8, 2026
Current Cursor documentation and staff guidance confirm that the OpenAI base URL override can route model requests through an OpenAI-compatible gateway. GoModel already exposes the required/v1/models, /v1/chat/completions, and
/v1/responses endpoints, so no GoModel application change is required for the
documented path. Local GoModel validation with openai/gpt-4.1-mini confirmed
text responses over Chat Completions and Responses, streaming Chat Completions,
and a standard function tool call.
The local test environment did not contain a runnable Cursor installation, so
the Cursor UI flow was not claimed as an end-to-end local validation. The
GoModel endpoints and model/tool behavior were tested separately; repeat
step 5 with the deployed URL and your Cursor
release before relying on Agent mode in production.