Connect Cursor to CaMeL Hub: One API Key for GPT, Claude, Gemini & DeepSeek
Cursor is an AI-first code editor built on top of VS Code, with built-in chat, multi-file editing (Composer), and an agent mode that can run terminal commands and read your codebase. By default its models run through Cursor's own subscription. Pointing Cursor at CaMeL Hub's OpenAI-compatible endpoint lets you pay as you go from your own CaMeL Hub balance instead, and pick from GPT-5.5, Claude Sonnet 5, Gemini 3.1 Pro, DeepSeek V4, and dozens of other models β all behind the one API key you may already use for other tools.
-
Grab your CaMeL Hub API key
Sign in to the CaMeL Hub console and open the Token page. Create a token (or reuse an existing one) and copy the key β it looks like sk-.... Before touching Cursor's settings, it's worth sanity-checking the key from a terminal:curl https://api.camel-hub.com/v1/chat/completions \ -H "Authorization: Bearer sk-your-camel-hub-key" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"ping"}]}' -
Open Cursor's Models settings
In Cursor, click the gear icon (top right) to open Settings, then switch to the Models tab. This is where Cursor lets you bring your own API key and endpoint for OpenAI-format providers. -
Point the OpenAI provider at CaMeL Hub
Paste your CaMeL Hub key into the field labeled OpenAI API Key, then turn on the option to override the request endpoint β usually a toggle or field named something like Override OpenAI Base URL / Base URL β and set it to the address below. Cursor will now send its OpenAI-format requests to CaMeL Hub instead of directly to OpenAI.https://api.camel-hub.com/v1 -
Add the models you actually want to use
Cursor's built-in model toggles (the ones bundled by default, like gpt-4o or claude-3.5-sonnet) are wired to Cursor's own backend and won't necessarily route through your override. To reliably reach CaMeL Hub's catalog, add each model as a custom entry β look for an βAdd modelβ or β+β control near the model list β and type the exact CaMeL Hub model slug, matching case:gpt-5.5 gpt-5.4-mini claude-sonnet-5 claude-opus-4-8 gemini-3.1-pro deepseek-v4-flash -
Verify the connection
Click Verify (or Save) next to the OpenAI API key field. Cursor sends a short test request through the endpoint you configured; a green check confirms both the key and the base URL are reachable. If it fails, see the FAQ below. -
Pick your model in Chat, Composer, or Agent
Open the model picker in the chat, Composer, or Agent panel β usually a dropdown showing the current model name β and select one of the custom models you just added. Every request against that model now bills against your CaMeL Hub balance instead of a Cursor subscription seat.
Frequently asked questions
My CaMeL Hub models don't show up in Cursor's model picker.
You likely enabled the OpenAI key and base-url override but never added the models as custom entries β Cursor's default toggle list doesn't automatically include newer CaMeL Hub models like gpt-5.5 or claude-sonnet-5. Go back to the Models tab and add each one by its exact slug (see step 4).
Verify fails even though the key works with curl.
Check for a trailing slash or a missing /v1 on the base URL (it must be exactly https://api.camel-hub.com/v1), stray whitespace pasted along with the key, and that the token hasn't been disabled or run out of quota in the CaMeL Hub console. A corporate proxy or firewall blocking Cursor's outbound requests can also fail verification even when a direct curl from your terminal succeeds.
Which model should I use for large refactors versus quick edits?
For multi-file Composer/Agent work and harder reasoning, pick a stronger model such as claude-sonnet-5 or claude-opus-4-8. For fast inline edits and small fixes, a lighter model like gpt-5.4-mini or deepseek-v4-flash keeps responses snappy. You can switch models per conversation in Cursor at any time.
Does this also change Cursor's Tab autocomplete?
No. Tab's inline code completion runs on Cursor's own proprietary model and isn't affected by the OpenAI key/base-url override β this setup only applies to Chat, Composer, and Agent requests.