Cursor IDE
Cursor IDE has native support for a custom OpenAI-compatible endpoint. Point it at an LLM Registry entry through the gateway's Cursor-compatibility path, and Cursor can use any provider the entry serves, including Gemini and Bedrock, not just OpenAI-family models.
All configuration lives in Cursor's Settings under Models. You'll do this in the UI, and there are no CLI commands to run.
Which setup do you need?
| What you get | Use it when | |
|---|---|---|
| LLM Registry entry | The model, governed | You only need model access |
| Agent Persona | The model and the persona's MCP tools | You want Cursor to use tools as well |
Connect to an LLM Registry entry
1. Enable "Override OpenAI Base URL"
In Cursor Settings → Models → API Keys:
- Toggle Override OpenAI Base URL on
- Paste the entry's URL, including the required
/api/v1/cursorsuffix:
https://<gateway-host>/llm/<url-prefix>/api/v1/cursor
2. Set the OpenAI API Key
Cursor has exactly one credential field, so what goes in it depends on your entry's credential mode. Cursor sends this value as Authorization: Bearer on every request.
| Your entry | Paste into OpenAI API Key |
|---|---|
| API Key, or AWS SigV4 | <your-agent-access-key> |
| Passthrough, Require an agent access key on | <your-provider-key>::<your-agent-access-key> |
| Passthrough, requirement off | <your-provider-key> |
The middle row is the combined form: two credentials in one field, provider key first, separated by two colons. The gateway splits the value apart before authenticating. Provider key first matters, because Cursor checks that a key looks well-formed and only this order passes that check. See clients with only one credential field for the full explanation.
Not sure which row applies? Which credentials does my entry need? settles it.
3. Enable the models you want to use
Below API Keys, Cursor lists its default OpenAI models. Toggle those off if you want to use custom-provider models exclusively, then use the Add or search model input to add each model ID from the entry's Allowed Models list. Enable the toggle next to each.
The identifier format depends on the provider:
- OpenAI
- OpenRouter
- Anthropic
- Gemini
- Bedrock
Add model IDs as they appear in the Allowed Models list. In passthrough mode, <your-provider-key> is your OpenAI API key.
Some OpenAI models return errors from Cursor when routed through the compatibility path. If a model fails, try a different one from the Allowed Models list. The issue is model-specific, not endpoint-wide.
Add OpenRouter model IDs using their vendor-scoped form (e.g., openai/gpt-5.1, anthropic/claude-sonnet-4.6, google/gemini-2.5-flash-lite, moonshotai/kimi-k2.5). In passthrough mode, <your-provider-key> is your OpenRouter API key.
Add Claude model IDs with a cq- prefix rather than exactly as the Allowed Models list shows them, so claude-sonnet-4-6 is added as cq-claude-sonnet-4-6. In passthrough mode, <your-provider-key> is your Anthropic API key.
The prefix is required, and leaving it off fails silently. Cursor sends any model whose name begins with claude- to its own separate Anthropic key and base URL, ignoring Override OpenAI Base URL completely. Cursor's own settings copy says so: that key "will be used for all models beginning with claude-". The request never reaches the gateway, so no policy applies and nothing appears in activity — it simply looks like it worked.
The cq- prefix keeps the model on the OpenAI-compatible path. The gateway strips it before doing anything else, so your Allowed Models list, the audit record, and Anthropic all see the real model ID. Only Anthropic model names trigger Cursor's built-in override, so no other provider needs this.
Cursor doesn't send a response-length limit of its own, so the gateway applies a default of 8192 tokens when it translates the request to Anthropic's format. If a long answer stops earlier than you expect, that ceiling is why.
Some Claude model IDs return errors from Cursor when routed through the compatibility path. If a model fails, try a different one from the Allowed Models list.
Add Gemini model IDs directly (e.g., gemini-3.6-flash, gemini-2.5-flash-lite, gemini-2.0-flash). In passthrough mode, <your-provider-key> is your Google API key.
Add Bedrock model IDs using their cross-region inference profile form (e.g., global.anthropic.claude-sonnet-4-6). A bare model ID like anthropic.claude-sonnet-5 returns "on-demand throughput isn't supported" from AWS. In passthrough mode, <your-provider-key> is your Amazon Bedrock API key.
Cursor doesn't send a response-length limit of its own, so the gateway applies a default of 8192 tokens when it translates the request to Bedrock's format. If a long answer stops earlier than you expect, that ceiling is why.
Connect through an Agent Persona
An Agent Persona bundles a set of MCP tools and, optionally, LLM access under one endpoint. Cursor reaches both, through two separate settings.
1. Point the model at the persona
Same Override OpenAI Base URL field as above, with the persona-scoped URL:
https://<gateway-host>/p/<persona-id>/llm/<registry-entry-id>/api/v1/cursor
The /api/v1/cursor suffix is still required. Fill the OpenAI API Key field exactly as in step 2 above, and add models the same way.
2. Wire the persona's tools
Add the persona's tools socket to ~/.cursor/mcp.json:
{
"mcpServers": {
"<persona-name>": {
"url": "https://<gateway-host>/p/<persona-id>",
"headers": { "X-Agent-Key": "<your-agent-access-key>" }
}
}
}
One Agent Access Key covers both. The same key authenticates the model route and the tools socket, whichever Inbound Authentication method the persona uses.
This route always requires an Agent Access Key, whatever the entry's credential mode. Fill the credential field using the API Key or Passthrough (Agent Access Key Required) guidance above; the third mode, Passthrough (No Agent Access Key), applies to the LLM Registry entry route only.
The tools socket URL is the persona root, with no /llm/... path and no /api/v1/cursor suffix. The model route and the tools socket are different endpoints on the same persona.
If you'd rather not edit the file by hand:
npx @cequenceai/mcp-cli@latest cursor \
--url "https://<gateway-host>/p/<persona-id>" \
--name "<persona-name>" \
--header 'X-Agent-Key: <your-agent-access-key>'
Where to find each value
| Placeholder | Where to find it |
|---|---|
<gateway-host> | Host from the entry's Overview tab |
<url-prefix> | The URL prefix field on the entry's Overview tab |
<persona-id> | The persona's ID on the Agent Persona page |
<persona-name> | Any short name you want Cursor to use for this MCP server locally |
<registry-entry-id> | The LLM Registry entry's ID in the entry's URL |
<your-agent-access-key> | Generate from the entry's Agent Access Keys step, or the persona's Connect flow. Plaintext is shown once. |
<your-provider-key> | Your own provider API key, needed only in the passthrough modes |
| Model IDs | The entry's Allowed Models list |
Tips
- The
/api/v1/cursorsuffix is required on the model URL. It's what tells the gateway to apply the Cursor-compatibility translation. Without it, Cursor's requests reach the gateway but the response shape may not match what Cursor expects. - Only the Override OpenAI Base URL field is used. Even for Anthropic or Gemini entries, keep the toggle for Override Anthropic Base URL / Override Google API Base URL off. Cursor routes everything through its OpenAI adapter when the OpenAI override is on, and the gateway's Cursor path handles the translation on its side.
- Test a single model first. Add one model from the Allowed Models list, enable it, and try a chat before adding the rest. That way if the base URL or key is wrong, you catch it before spending time enabling ten models.
- Custom model IDs stay case-sensitive. Cursor stores the exact string you type, and the gateway forwards it verbatim. Match the entry's Allowed Models list exactly.
- Two colons, no spaces. In the combined credential,
::is the separator. A space on either side becomes part of the credential and authentication fails. - An "invalid API key" error may be about the wrong key. On a passthrough entry that requires an Agent Access Key, sending only your provider key fails authentication even though that key is perfectly good. Check which credentials your entry needs before regenerating anything.
Cequence AI Gateway