Cursor को OpenRouter से कैसे जोड़ें: सेटअप, फीचर सीमाएँ और समस्या समाधान
Cursor को OpenRouter से जोड़ने, Activity में routing साबित करने, Chat, Agent, Tab और tools को अलग-अलग जाँचने तथा endpoint, model, credit और rate-limit errors हल करने की गाइड।
विषय-सूची

मुख्य बात यह है: Cursor में जवाब मिल जाना इस बात का प्रमाण नहीं है कि Cursor का हर फीचर OpenRouter इस्तेमाल कर रहा है। 4 अक्टूबर 2026 तक OpenRouter ने Cursor integration को Beta के रूप में चिह्नित किया हुआ है और dedicated Base URL https://openrouter.ai/api/v1/cursor माँगा है। जब आप OpenRouter model को manually चुनते हैं, तब Chat और Agent की model requests इस route से जा सकती हैं। Tab Completion custom API Key का उपयोग नहीं करता, और tool calling तभी काम करता है जब endpoint सही हो और चुना गया model tools support करता हो।
इसलिए सही acceptance test “key डालकर जवाब देखना” नहीं, बल्कि evidence chain है: सही settings → model को manually चुनना → छोटा test request → OpenRouter Activity में matching record → Agent और tools की अलग जाँच। यह लेख मौजूदा official documentation पर आधारित है। इसमें किसी live account, API Key, request log या किसी एक Cursor build पर पूर्ण end-to-end test का दावा नहीं किया गया है।
कौन-सा Cursor फीचर custom key इस्तेमाल करता है?
| Cursor फीचर | अपेक्षित OpenRouter routing | महत्वपूर्ण सीमा | सबसे अच्छा verification |
|---|---|---|---|
| Chat या Ask में manually चुना model | सामान्यतः हाँ | Model OpenRouter के OpenAI-compatible path पर उपलब्ध होना चाहिए | छोटा prompt भेजें और Activity में समय व model मिलाएँ |
| Agent में manually चुना model | Model call सामान्यतः route हो सकता है; हर internal action सिद्ध नहीं | Official guide Agent panel में model selection बताती है, हर helper request नहीं | Activity record और Cursor की visible tool actions दोनों देखें |
| Tab Completion | नहीं | Tab Cursor के built-in models इस्तेमाल करता है | Tab suggestion को OpenRouter का प्रमाण न मानें |
| Agent tool calling | शर्तों के साथ | Dedicated /cursor endpoint और tools support वाला model चाहिए | पहले Chat verify करें, फिर read-only Agent task चलाएँ |
| Automatic model selection | Acceptance के लिए कमजोर evidence | Client दूसरा model या route चुन सकता है | Auto बंद करके added model साफ़ तौर पर चुनें |
यहाँ model request और tool execution को अलग समझना जरूरी है। OpenRouter tool-calling documentation के अनुसार model tool call सुझाता है, जबकि client tool चलाता है और result वापस model को देता है। Activity record यह साबित कर सकता है कि model request OpenRouter तक पहुँची, लेकिन यह अकेले साबित नहीं करता कि file read या terminal command OpenRouter पर चला।
सेटअप से पहले क्या तैयार रखें
- Cursor का current version, जिसमें
Cursor Settings→Models→API Keysउपलब्ध हो। - आपका अपना OpenRouter API Key। इसे chat, repository, screenshot या support message में न डालें।
- Current OpenRouter catalog से copy किया गया exact Model ID। Display name देखकर अनुमान न लगाएँ।
- Agent tools के लिए tool-capable model filter में confirm किया गया model।
Cursor के अलग versions में button का नाम enable, save, confirm या verify हो सकता है। Field relationship वही रहता है: OpenRouter key OpenAI API Key में, endpoint Override OpenAI Base URL में और model का पूरा OpenRouter ID।
Cursor को सही क्रम में configure करें
1. API Key settings खोलें
Cursor Settings → Models पर जाएँ, API Keys expand करें और OpenAI API Key तथा Override OpenAI Base URL खोजें।
2. OpenRouter key डालें
OpenRouter account में बनाई गई key को OpenAI API Key में paste करें। Key केवल Cursor settings UI में डालें। Current client जो save, enable या validation action दिखाए, उसे पूरा करें।
3. Dedicated Cursor endpoint इस्तेमाल करें
Override OpenAI Base URL enable करें और यह value डालें:
https://openrouter.ai/api/v1/cursor
इसे generic https://openrouter.ai/api/v1 से replace न करें और /chat/completions append न करें। Dedicated /cursor endpoint Cursor के request format को normalize करता है; generic endpoint पर tool calls और कुछ request formats fail हो सकते हैं।
4. Exact Model ID जोड़ें
Models में + Add model चुनें और current OpenRouter model page से पूरा ID copy करें। Router alias इस्तेमाल हो तो उसकी पूरी current syntax copy करें। Marketing name, short name या पुराने tutorial का ID न लें।
5. Model को manually चुनें
Chat या Agent panel पर वापस जाएँ और added model को स्पष्ट रूप से select करें। पहले acceptance test में automatic selection न रखें, क्योंकि response मिलने के बाद भी route पता नहीं चलेगा।
कैसे साबित करें कि configuration active है
Chat में एक छोटा request भेजें जिसमें code या secret न हो, जैसे model से एक fixed short phrase लौटाने को कहना। तुरंत OpenRouter Activity खोलें और देखें:
- timestamp test से मेल खाता है;
- recorded model Cursor में चुने गए Model ID से मेल खाता है;
- request सफल है और usage data मौजूद है;
- internal evidence में API Key, पूरा prompt या sensitive code नहीं है।
Cursor response कमजोर evidence है; matching Activity entry routing का अधिक मजबूत evidence है। अगर Cursor जवाब देता है लेकिन Activity record नहीं मिलता, route को “unconfirmed” मानें।
Team rollout में केवल समय, model, status, आवश्यक request identifier, Cursor version और test mode दर्ज करें। इससे Beta behavior बदलने पर test दोबारा किया जा सकेगा।
Chat, Agent, Tab और tools को अलग-अलग जाँचें
Chat: पहले baseline बनाएँ
OpenRouter model manually चुनें और छोटा deterministic prompt भेजें। Matching Activity record मिलने पर ही Chat pass माना जाए। अगर यह fail हो, Agent पर न जाएँ, क्योंकि Agent context, permissions और tools जैसे अतिरिक्त variables जोड़ता है।
Agent: model routing और orchestration अलग रखें
Disposable या आसानी से restore होने वाला repository इस्तेमाल करें। पहले low-risk task दें, जैसे README पढ़कर सुधार सुझाना, और file write या destructive command की अनुमति न दें। दो अलग signals जाँचें:
- OpenRouter Activity में model request आया।
- Cursor ने expected file read या दूसरी tool action दिखाई।
पहला model routing सिद्ध करता है; दूसरा Cursor Agent orchestration। Official material यह सिद्ध नहीं करता कि Agent की हर background helper request हमेशा उसी custom key से जाती है, इसलिए एक successful run से पूरे internal traffic पर निष्कर्ष न निकालें।
Tab: Activity में न दिखना expected है
Code type करते समय Tab suggestion केवल Cursor Tab Completion को test करता है। Official docs के अनुसार custom keys chat models के लिए हैं और Tab built-in models इस्तेमाल करता है। इसलिए “Chat Activity में दिखता है, Tab नहीं” कोई configuration error नहीं है।
Tools: endpoint और model capability साथ जाँचें
Chat pass होने के बाद ऐसा model चुनें जिसके catalog data में tools support हो। Test repository में read-only task दें, जैसे files list करना या छोटा file पढ़ना। अगर text Chat चलता है लेकिन tools fail होते हैं, तो क्रम से जाँचें:
- Base URL exactly
https://openrouter.ai/api/v1/cursorहै; - model explicitly
toolssupport करता है; - Cursor ने model automatically switch नहीं किया;
- tool permission deny नहीं हुई;
- दूसरा confirmed tool-capable model भी वही error देता है या नहीं।
लक्षण के आधार पर troubleshooting
| लक्षण | संभावित कारण | सबसे आसान पहली जाँच | Fix के बाद retest |
|---|---|---|---|
| Key rejected या authentication failure | Invalid/revoked key, extra spaces, या key और endpoint अलग providers के | Active key फिर copy करें और provider match जाँचें | Session restart करके minimal Chat भेजें और Activity देखें |
| Model not found / 404 | गलत Model ID, incomplete alias या compatible endpoint पर model उपलब्ध नहीं | Current catalog से पूरा ID copy करें | Manually select करके वही prompt दोहराएँ |
| Chat चलता है, Agent tools fail | Generic /api/v1 या tools support न करने वाला model | /cursor suffix और supported_parameters=tools जाँचें | Read-only task चलाकर Activity देखें |
| Chat चलता है, Tab Activity में नहीं | Tab custom key इस्तेमाल नहीं करता | Key या endpoint न बदलें | Chat और Tab को अलग features मानें |
| 402 response | Credits, per-key cap या in-flight budget कम | Key/credit page और error metadata देखें | Wait करें, request छोटा करें या credits जोड़ें |
| 429 response | OpenRouter या upstream provider limit | Retry-After और rate-limit headers देखें; तुरंत resend न करें | Exponential backoff से wait करके retry करें या दूसरा route चुनें |
| Cursor जवाब देता है, Activity record नहीं | Built-in model, Auto या settings लागू नहीं | Added model manually चुनें और key/Base URL दोबारा देखें | Session restart करके minimal request दोहराएँ |
| Settings में fields नहीं | Cursor version, plan या UI बदल गया | Cursor update करें और current BYOK docs खोलें | Current UI में वही field relationship बनाकर retest करें |
429 पर OpenRouter limits guide देखें, Retry-After follow करें और exponential backoff इस्तेमाल करें। अधिक keys बनाना globally managed capacity को bypass करने का भरोसेमंद तरीका नहीं है। Tool errors में advanced Agent settings बदलने से पहले endpoint और model capability ठीक करें।
BYOK का अर्थ direct Cursor-to-OpenRouter connection नहीं है
Cursor BYOK documentation के अनुसार final prompt assembly के लिए requests Cursor backend से गुजरती हैं। Sensitive code वाली teams को Cursor और selected provider दोनों की data practices देखनी चाहिए। Troubleshooting screenshot में real keys, customer data या private source code न रखें; sanitized minimal reproduction इस्तेमाल करें।
Plans, billing rules और UI availability बदल सकती हैं। Production rollout से पहले official Cursor और OpenRouter pages फिर खोलकर उस दिन का behavior verify करें।
BetterToken एक अलग configuration path है
अगर लक्ष्य OpenRouter नहीं, बल्कि कोई दूसरा OpenAI-compatible gateway है, तो BetterToken की अलग Cursor setup guide है। उसका Base URL https://www.bettertoken.ai/v1 है और उसे BetterToken API Key तथा BetterToken Model ID के साथ ही इस्तेमाल करना चाहिए।
OpenRouter key को BetterToken endpoint के साथ या BetterToken key को https://openrouter.ai/api/v1/cursor के साथ न मिलाएँ। Provider बदलने पर minimal Chat test और संबंधित dashboard का usage record दोबारा verify करें।
अंतिम acceptance order
यह क्रम रखें: एक model configure करें → manually select करें → minimal Chat भेजें → Activity record खोजें → Agent और tools test करें → Tab को अलग built-in feature की तरह accept करें। इससे error endpoint, key, model, tools, credit या rate limit की स्पष्ट layer में रहेगा।