Skip to content
Router One

Bring your own key to Cursor through one endpoint

Cursor is one of the most popular AI code editors, and its settings let you bring your own API key: override the OpenAI base URL, paste a key, and the chat models you pick in Cursor's chat and Agent panel bill through that key. Pointing the override at Router One puts GPT, Claude, Gemini, and Grok family models behind one key — pay-as-you-go, as low as 10% of official list prices on select models, with a per-request cost trace for every call. To be precise about scope: the key covers the chat models you select, while Cursor's own features — Tab autocomplete, Auto, and its Composer models — keep running on Cursor's built-in models. Cursor also accepts a custom key only on its paid plans, so this replaces your model bill, not your Cursor subscription.

Configure Cursor to use the Router One base URL

Open Cursor → Settings → Models → OpenAI API Key, enable "Override OpenAI Base URL", set it to the gateway URL, paste your Router One key, and click Verify. Pick a listed model, or add the exact ID from the /models page as a custom model:

cursor-settings
# Cursor → Settings → Models → OpenAI API Key
Override OpenAI Base URL:  https://api.router.one/v1
API Key:  sk-your-router-one-key
Model:    <copy the exact ID from /models>

Which model ID should Cursor send?

Copy the exact model ID from /models, preserving case, hyphens, and version suffixes; do not substitute a display name. Open its detail page and match the supported API endpoints, context window, and capabilities such as tool calling to the provider and features selected in Cursor. A catalog listing does not mean the client can use every feature of that model. Give each tool a dedicated API key with a maxSpend cap.

Which API protocol is Cursor using?

OpenAI-compatible describes an interface format; it does not make Chat Completions (/v1/chat/completions), Responses (/v1/responses), and Anthropic Messages (/v1/messages) interchangeable. Check the installed client version, provider configuration, and actual request path against the model detail page and API compatibility fact sheet. A successful plain-text chat does not establish support for hosted tools, conversation state, or file-editing features.

Verify the Cursor call in your request trace

Send a simple text request from Cursor, then match its trace in Dashboard → Logs by time, model, and request_id: tokens, cost, latency, and status. Next, test streaming, tool calls, and multi-turn history separately. For failures, retain the actual request path, full error message, and request_id. If there is no matching log, check client configuration and connectivity before attributing the error to the gateway or upstream.

FAQ

Does the override cover Cursor Tab autocomplete?

No. The base-URL override applies to the chat models you pick in Cursor's chat and Agent panel; Tab autocomplete, Auto, and Cursor's own Composer models keep running on Cursor's built-in models and are billed by your Cursor plan. Cursor also accepts a custom key only on its paid plans. Using Cursor from Mainland China? The China-specific setup with Alipay billing has its own guide, Cursor in China, at /cursor-china.

Does Agent mode run on my key?

Ordinary chat turns and standard tool calls in Ask and Agent go through your key, and each one lands in Dashboard → Logs with its model, tokens, cost, and status. File-edit flows depend on Cursor's own custom-tool format, so treat those as worth trying rather than guaranteed — if an edit fails, open Logs first to see whether the request reached the gateway at all.

Why does Claude Opus 5 hit a context limit in Cursor?

Router One serves claude-opus-5 with a million-token context window — the /models page shows the live figure, 1.05M today. Cursor sends its own per-model Context setting, and that value is not automatically the maximum: open the model picker in the chat pane, edit the model's parameters, set Context to 1M (older Cursor builds expose this as the MAX toggle), then start a new chat and try again.

Which models can Cursor use through the gateway?

Choose a current catalog model that supports both the endpoint and the features Cursor uses. Check /models and the model detail page for the exact ID, current rates, and capabilities; a family name such as GPT or Claude is not a compatibility guarantee. Seeing a model in the picker confirms discovery, so verify an actual request too.

Models are listed, but requests fail with 400 or 404. What should I check?

Record the actual request path and error message, then check the exact model ID. A 400 can indicate invalid parameters, unsupported tools, or a model/endpoint mismatch; a 404 can indicate an incorrect path or missing resource, so it does not by itself establish that a model was retired. If the error says must be called via, use the named endpoint or select a model supported on the current endpoint. Do not add or remove /v1 or /chat/completions across all clients indiscriminately.

Does this work from Mainland China?

Yes. The gateway is reachable from Mainland China without a VPN, and the configuration is identical to the global setup.

How do I debug a 401/402/403/429?

Match the request and error message in Dashboard → Logs. For 401, check whether the key was sent and is valid; for 402, check wallet balance and maxSpend; for 403, check key permissions and access restrictions. For 429, distinguish request/token limits from upstream throttling using the error details. Keep the request_id and follow the error-codes reference.