Cursor ships with built-in access to several models out of the box, but its settings also expose a path for pointing the editor at a custom OpenAI-compatible endpoint — useful if you already have a gateway key covering several providers and would rather not manage a second, separate subscription just for your editor.
Where this setting lives
Cursor's model settings include an option to override the API base URL and supply your own API key for OpenAI-compatible models (and separately for Anthropic-compatible Claude models). The exact menu labels shift between Cursor releases, so the safest approach is searching the in-app settings for "API Key" or "Override" rather than following a fixed click-path from an older screenshot.
What "OpenAI-compatible" means for Cursor specifically
Cursor's custom-provider slot expects the same request/response shape as OpenAI's Chat Completions API. Any gateway that speaks that format — regardless of which model actually processes the request upstream — works without Cursor needing to know anything changed.
Setting it up
- Open Cursor's settings and find the model provider section.
- Enable the custom API / override option for OpenAI-compatible models.
- Paste in your gateway's base URL.
- Paste in your gateway API key.
- Select (or manually type) the model identifier you want to use by default.
- Send a test message in a new chat to confirm the override is active rather than silently falling back to Cursor's default provider.
How do I confirm the override actually took effect?
The most reliable check is usage attribution: if requests show up in your gateway's usage dashboard immediately after a test message, the override is live. If nothing shows up after a minute, Cursor is likely still using its built-in default.
Common configuration mistakes
| Mistake | What happens | Fix |
|---|---|---|
| Base URL includes a trailing path segment meant for a different SDK | Requests 404 or return malformed responses | Use exactly the base URL your gateway documents, no extra path appended |
| API key pasted with a leading/trailing space | Silent 401 that looks like a Cursor bug | Re-paste the key directly from the dashboard, avoid retyping |
| Model identifier doesn't match any model the gateway maps | "Model not found" style error | Copy the exact model string from the gateway's supported-models list |
Why point Cursor at a gateway instead of its built-in models?
Two reasons come up repeatedly: model choice and consolidated billing. Cursor's built-in options are necessarily a curated subset; a gateway that exposes Claude, GPT, DeepSeek, GLM, Kimi, Qwen, Llama, and Grok behind one key lets you pick per-task rather than per-editor-default, and keeps the spend on one invoice instead of split across your editor subscription and a separate API account.
Is this worth doing if I only use Cursor occasionally?
If your usage is light, the built-in defaults are usually simpler. The override pays off once you're already paying for a gateway key elsewhere and want Cursor on the same ledger, or once you specifically need a model Cursor doesn't offer by default.
PioModel's API keys work directly in Cursor's custom-provider slot with no translation layer in between, since the endpoint is OpenAI-compatible by design.




コメント
サインインしてディスカッションに参加してください