If you’ve tried using some custom AI provider in Cursor you’ve probably seen this:
Cursor restricts localhost (127.0.0.1), making it difficult to use local proxies or self-hosted
models. Cursor overrides model names (e.g., claude-*, gpt-*, or others) and forces them through its own integrations, ignoring your custom API settings. This means:
Models that work fine on your provider fail in Cursor with errors like “Model not found” or “Not authorized”.
Even if you configure everything correctly, Cursor prioritizes its own settings.
Note: This only works with Cursor Pro or higher (custom providers aren’t available on the free plan).
I built cursor-custom-provider to solve these issues:
Solves Localhost Restrictions: Allows a secure public HTTPS connection (via ngrok, Cloudflare, or Pinggy) so Cursor can reach your proxy.
Model Name Translation: Add a custom prefix (e.g., `custom-claude-sonnet-4.6`) in Cursor to work seamlessly with its validation. The proxy strips the prefix and forwards the correct name to your provider.
Zero dependencies: Just Python + your provider’s API key.
Works with any provider: Whether it’s cloud-based, local, or custom.
Example:
In Cursor: Select `custom-claude-sonnet-4.6` (instead of Claude Sonnet 4.6).
The proxy translates it to `claude-sonnet` and sends it to your provider.
Run it with your provider’s API key and ngrok token.
Configure Cursor to use your proxy URL with a prefix (e.g., `custom-claude-sonnet-4.6`).
This isn’t about a specific provider—it’s about making Cursor respect your API settings. Let me know if you’ve run into the same issues! Hope this can help anyone who has found the same problem as me!
Hi xFurti, thanks for building this. The concept is brilliant and exactly what’s needed to bypass Cursor’s native model routing.
However, I ran into a massive roadblock trying to use it with OneProvider, and I wanted to share it in case you or others have found a workaround.
The issue is that OneProvider (and likely other providers) protects its API endpoints with strict Cloudflare anti-bot rules (WAF). When your Python proxy script tries to forward the request, Cloudflare immediately flags the script as a bot/scraper and blocks it with a 403 Forbidden error. My API key is fully funded, valid, and specifically purchased for Claude models, but the proxy’s request never even reaches the provider’s backend.
This creates a really frustrating Catch-22 for me:
If I use your proxy: The model prefix translates correctly, but Cloudflare blocks the Python script’s connection (403 Forbidden).
If I bypass your proxy (connecting Cursor directly to the provider): Cursor’s native requests pass Cloudflare’s checks perfectly. But then Cursor intercepts the claude- models. If I try to use a prefix like custom-claude directly to avoid the interception, the provider obviously returns a “model not available” error because the proxy isn’t there to strip the prefix.
Have you encountered this WAF/Cloudflare block with the Python standard libraries used in your script? Do you think there’s a way to spoof Cursor’s native headers within the proxy, or perhaps use a library like cloudscraper to bypass the WAF?
Hey Fabio — thanks a lot for writing this, and for the kind words.
This repo is from about two months ago and was one of my first public projects. I honestly didn’t expect people to still find it. Seeing that it actually helped is the reason I want to pick it back up.
I already had a v2 in mind: a small web dashboard for token usage, a cleaner/faster proxy, and a few quality-of-life fixes. Your note about Cloudflare WAF / 403 on the Python client is going on that list. The current version uses the standard library on purpose (urllib), which some providers treat as a bot even when the same key works from Cursor. I want the next version to handle that class of providers better — without turning the tool into a WAF bypass.
I don’t have a date yet, but this is useful signal. Thanks again for taking the time to write it up.
Honestly, it’s a huge relief to hear that the urllib library was the actual culprit behind the 403 error. I spent half the night going crazy, trying to figure out if my API key was somehow broken or if I had messed up the config.json!
A v2 sounds amazing. A web dashboard for token usage and a proxy that plays nicely with those strict providers would be a game changer for Cursor users. Take all the time you need, you already built something incredibly useful.
Whenever you drop the new version, I’ll be more than happy to test it out with OneProvider and let you know how it goes.
I picked v2 back up and I’m working on it now. Goal is next week, or the next few weeks if I need more time.
When it ships I’ll announce it here (update this thread or a new post) with what’s new — token-usage dashboard, a cleaner proxy, and the other quality-of-life stuff.
Happy to have you try it against OneProvider when it’s ready.
Awesome update, Leonardo! Thanks for letting me know.
Take all the time you need to get it right. I’ll definitely keep an eye out for the announcement, and I’m ready to stress-test it with OneProvider as soon as you drop it.