Connect Cursor to an OpenAI-compatible API.

Set Cursor’s OpenAI API key and custom base URL, resolve built-in ID collisions, and check team key restrictions.

Cursor can use a custom OpenAI-compatible endpoint for chat requests. The setup is in Cursor Settings → Models: enable the OpenAI API key and override the OpenAI base URL, then select a built-in model or add a custom model ID. The two choices behave differently when a model name already exists or a team restricts personal keys.

First choose how Cursor should identify the model

If the ID is already in Cursor's model picker, select that built-in model and route it through the OpenAI base URL override. Add a custom model only when Cursor does not already provide the ID.

Set the OpenAI-compatible endpoint

  1. Open Cursor Settings → Models and expand the API Keys section.
  2. Under OpenAI API Key, enter the key issued by your endpoint and turn on Use OpenAI API Key.
  3. Turn on Override OpenAI Base URL and enter the API base documented by the endpoint. Use its API root, not a URL copied from a chat page.
  4. Choose an existing built-in GPT model, or add a custom model using the exact ID the endpoint expects. Save, restart Cursor if it does not refresh the model list, and open a new chat.

Cursor's own setup labels and routing can change between releases. If your version puts these controls elsewhere, check its current Models settings and the linked Cursor documentation.

Built-in ID or custom ID?

  • The custom model form says “No models available.” If you entered an ID already present in Cursor, remove the duplicate and select the built-in model. In a June 2026 support reply, Cursor explained that a duplicate built-in ID is rejected; the reported GPT example used the existing model with the OpenAI base URL override.
  • The endpoint says “model not found.” Compare the model value Cursor sends with the endpoint's exact API model ID. Display names and API IDs can differ; case and provider-specific aliases can matter.
  • Your OpenAI-compatible ID starts with claude-. Cursor support reported that this prefix selects the Anthropic key slot for custom models. If the endpoint expects OpenAI-compatible authentication, use a provider-side alias that does not begin with that prefix, then match the alias to the model it serves.

Read the error at the right layer

What you seeCheck first
The API Keys section is missingOn a team account, ask its Cursor admin whether personal API keys are restricted. Cursor support says this policy can hide the whole section.
Model name is not validConfirm Use OpenAI API Key is on, the team permits OpenAI personal keys, and the model name is routed to the expected key slot. A saved key with its toggle off is not enough.
401 or unauthorizedCheck that the key belongs to this endpoint, is active, and is being sent through the OpenAI key slot. Do not replace it with a Cursor account token.
404 or route not foundCompare the actual request path with the endpoint's documented OpenAI-compatible API path. A wrong model ID, base URL and unsupported route can produce different 404s.
The key verifies but chat failsCheck the raw status and provider response body, then compare the endpoint's supported Chat Completions fields. Key verification does not prove that every Cursor request feature is supported.

Check BYOK scope, billing and privacy

Cursor's current documentation says custom API keys work with chat models; Tab completion continues to use Cursor's built-in models. Your model provider bills its model usage. Team and Enterprise plans may also apply Cursor's own token rate or team spend limit to eligible requests, so check the plan settings before assuming BYOK removes every Cursor charge.

Cursor also says BYOK requests pass through its backend for prompt building and that its Zero Data Retention policy does not apply to requests using your own provider key. Review Cursor's current key and privacy documentation for the data path your team accepts.

Using ChinaGenAI

ChinaGenAI exposes an OpenAI-compatible Chat Completions endpoint. The Cursor configuration itself has not been tested against this site. Check current site API access and limits on the status page before using a site key. The shared route is tightly capped, including a 256-token output ceiling, so treat it as a short text check; a repository-aware coding task can exceed its input and output limits.

For the site's exact base URL, route, key rules and supported request shape, see connection details. A compatible API shape does not certify Cursor Agent, Tab completion, tool use or long coding sessions.

Cursor references

Sources checked 27 October 2026. The forum findings are specific support cases, not a measure of how often each error occurs. No Cursor installation, account, provider key or model request was used.

Free API access and limits

Check the site free API access and limits before trying to obtain a site key. Read the current status and request limits before using a site key. It is not a source of official provider keys.

ChinaGenAI is not affiliated with the providers named here. This release contains setup guidance and explicitly labeled fictional examples, not claimed live model benchmarks.

Exact symptom wording and source

Use the quoted text to locate the relevant check. Providers and clients can phrase the same failure differently; compare the complete response before applying a fix.

  • Reported text: Cursor "No models available" when adding a built-in model ID

    Cursor staff traced this report to a custom model ID colliding with a built-in model. Check the current model picker; this one report does not establish the cause of every empty model list.

    Open this check

    No models available

    Cursor staff reply, 20 June 2026

  • Reported text: Cursor "Model name is not valid" with an OpenAI-compatible endpoint

    Support traced one report to a disabled OpenAI personal-key switch or a custom model name routed to another provider key slot. Check the installed Cursor version and team settings; this is not a universal error mapping.

    Open this check

    Model name is not valid

    Cursor staff replies, 28–29 September 2026

  • Reported text: Cursor API Keys section missing on a Team or Enterprise account

    In one Enterprise support case, this team policy hid the API Keys section. Ask the team admin to check the current policy; do not treat this as a client-side endpoint failure.

    Open this check

    Restrict Personal API Keys

    Cursor staff reply, 28 September 2026