# Use Cursor with Open-source LLMs

**URL:** <https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686>\
**Category:** Help\
**Created:** [August 4, 2025, 10:30am UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686 "2025-08-04T10:30:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![LARAMediaGroup](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/laramediagroup/32/58850_2.png) [@LARAMediaGroup](https://forum.cursor.com/u/LARAMediaGroup)\
**Post date:** [August 4, 2025, 10:30am UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/1 "2025-08-04T10:30:13Z")

</div>

Is it possible to use Cursor with our APIs from open-source LLMs like GLM 4.5, Qwen3, etc? If not, can you guys suggest an alternative, please?

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [August 4, 2025, 10:54am UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/2 "2025-08-04T10:54:00Z")

</div>

Hey, yes, you can use your API keys for these models, but unfortunately, Cursor might not support some API providers. However, you can use [OpenRouter](https://openrouter.ai/), as Cursor supports this API provider.

---

<div class="post-metadata">

**Author:** ![LARAMediaGroup](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/laramediagroup/32/58850_2.png) [@LARAMediaGroup](https://forum.cursor.com/u/LARAMediaGroup)\
**Post date:** [August 4, 2025, 10:58am UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/3 "2025-08-04T10:58:11Z")

</div>

So, get the API via the OpenRouter and then use that specific API via the cursor interface? Will it work as an agent or just asking?

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [August 4, 2025, 11:24am UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/4 "2025-08-04T11:24:40Z")

</div>

You need to register on OpenRouter, then create your [API key](https://openrouter.ai/settings/keys). After that, you need to add it in Cursor and override the base URL to this address: `https://openrouter.ai/api/v1`, and add the model name to the list of models. Yes, it will work in agent mode.

 ![CleanShot 2025-08-04 at 14.23.48@2x](https://us1.discourse-cdn.com/cursor1/original/3X/f/2/f2b6c5cdddf74e663bd233df7609368708d97790.png)

 ![CleanShot 2025-08-04 at 14.22.06@2x](https://us1.discourse-cdn.com/cursor1/original/3X/2/f/2f0916acbd568d209a7a8babe8e496cb6739bc07.png)

---

<div class="post-metadata">

**Author:** ![LARAMediaGroup](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/laramediagroup/32/58850_2.png) [@LARAMediaGroup](https://forum.cursor.com/u/LARAMediaGroup)\
**Post date:** [August 4, 2025, 1:08pm UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/5 "2025-08-04T13:08:54Z")

</div>

![Screenshot 2025-08-04 at 14.04.05](https://us1.discourse-cdn.com/cursor1/original/3X/b/c/bc8b175079a6c74dd701f2d4f56a7ed3943b8c7a.png)

 ![Screenshot 2025-08-04 at 14.07.29](https://us1.discourse-cdn.com/cursor1/original/3X/a/e/ae67b751350a5d59ee1e803312971a29456e4038.png)

 ![Screenshot 2025-08-04 at 14.05.27](https://us1.discourse-cdn.com/cursor1/original/3X/4/9/49cabe8864ab2c32b5dca1355c38a10d7478c76b.png)

HI **[deanrie](https://forum.cursor.com/u/deanrie),** thank you for the screenshots, but it does not work here. I wonder, is there anything wrong with our current 1 year Cursor plan? Please advise.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [August 4, 2025, 2:08pm UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/6 "2025-08-04T14:08:34Z")

</div>

You have the model added incorrectly, it should be `openrouter/horizon-beta`.

---

<div class="post-metadata">

**Author:** ![LARAMediaGroup](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/laramediagroup/32/58850_2.png) [@LARAMediaGroup](https://forum.cursor.com/u/LARAMediaGroup)\
**Post date:** [August 4, 2025, 3:33pm UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/7 "2025-08-04T15:33:36Z")

</div>

I typed that name there, had no idea that the typed name has to be EXACTLY that, will try again and let you know.  
Update: Nah, does not work. When I click on verify API, nothing happens. Not a single bip (good, bad, error…nada). I now typed the exact name as you stated but I get the exact error.

 ![Screenshot 2025-08-04 at 16.36.45](https://us1.discourse-cdn.com/cursor1/original/3X/e/a/ea2420ab0526d1a33b0e839bfc0f87bd872b5ae4.jpeg)

 ![Screenshot 2025-08-04 at 16.36.16](https://us1.discourse-cdn.com/cursor1/original/3X/b/b/bb894a8a2d238ef56f04b91d65ebdd7e8a14e0c0.png)

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [August 4, 2025, 3:48pm UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/8 "2025-08-04T15:48:55Z")

</div>

Try enabling all the settings here, and also try adding any other model, for example `google/gemini-2.5-flash-lite`

> **[OpenRouter](https://openrouter.ai/sign-in?redirect_url=https%3A%2F%2Fopenrouter.ai%2Fsettings%2Fprivacy)**
>
> The unified interface for LLMs. Find the best models & prices for your prompts

---

<div class="post-metadata">

**Author:** ![LARAMediaGroup](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/laramediagroup/32/58850_2.png) [@LARAMediaGroup](https://forum.cursor.com/u/LARAMediaGroup)\
**Post date:** [August 4, 2025, 4:07pm UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/9 "2025-08-04T16:07:18Z")

</div>

Geeee, you’re a genius, that did it! Thank you so much \<3

---

<div class="post-metadata">

**Author:** ![LARAMediaGroup](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/laramediagroup/32/58850_2.png) [@LARAMediaGroup](https://forum.cursor.com/u/LARAMediaGroup)\
**Post date:** [August 4, 2025, 7:45pm UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/10 "2025-08-04T19:45:09Z")

</div>

Update: It kind of works, but we keep getting this error:

 ![Screenshot 2025-08-04 at 20.44.15](https://us1.discourse-cdn.com/cursor1/original/3X/3/4/34f345d6f636008dbdf280f02d29e0d20d47862a.png)

Any idea what’s wrong or how to avoid it?

UPDATE: it is unusable now, none of the API keys are working, seems like a Cursor bug or block, please advise.

---

<div class="post-metadata">

**Author:** ![theio](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/theio/32/60036_2.png) [@theio](https://forum.cursor.com/u/theio)\
**Post date:** [August 5, 2025, 12:18am UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/11 "2025-08-05T00:18:17Z")

</div>

Hi, is it possible to separate openAI api keys and various providers like openrouter? Right now, setting this up makes o3 and other openAI model unusable, so it is impossible to use openrouter and openAI models at the same time, which is quite sad.

---

<div class="post-metadata">

**Author:** ![decsters01](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/decsters01/32/10082_2.png) [@decsters01](https://forum.cursor.com/u/decsters01)\
**Post date:** [August 5, 2025, 2:16am UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/12 "2025-08-05T02:16:15Z")

</div>

nao funciona pra min a dias

---

<div class="post-metadata">

**Author:** ![Naufaldi\_Rafif](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/naufaldi_rafif/32/73623_2.png) [@Naufaldi\_Rafif](https://forum.cursor.com/u/Naufaldi_Rafif)\
**Post date:** [August 5, 2025, 3:19am UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/13 "2025-08-05T03:19:12Z")

</div>

i have this kind problem too, since its bug. its this acknowladge by dev @deanrie ?

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [August 5, 2025, 4:23am UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/14 "2025-08-05T04:23:17Z")

</div>

Yes, it’s a bug. I hope we fix it soon.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [August 5, 2025, 4:25am UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/15 "2025-08-05T04:25:04Z")

</div>

Thanks for the feedback. I understand that another field for the API key would be useful, and I’ll let the team know about it.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [August 5, 2025, 4:26am UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/16 "2025-08-05T04:26:16Z")

</div>

I just checked and everything is working for me. It might have been temporary. Let me know if it works for you.

---

<div class="post-metadata">

**Author:** ![LARAMediaGroup](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/laramediagroup/32/58850_2.png) [@LARAMediaGroup](https://forum.cursor.com/u/LARAMediaGroup)\
**Post date:** [August 5, 2025, 12:24pm UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/17 "2025-08-05T12:24:18Z")

</div>

We encountered the same bug with all other models. To get it working again, we had to remove Horizon Beta and stop the API key. It’s definitely a Cursor bug; I hope you can investigate and get to the bottom of it.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [August 5, 2025, 12:27pm UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/18 "2025-08-05T12:27:35Z")

</div>

Hey, could it be that the API key is incorrect? If you previously had a different API key for OpenAI, try re-entering the key and clicking verify.

---

<div class="post-metadata">

**Author:** ![LARAMediaGroup](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/laramediagroup/32/58850_2.png) [@LARAMediaGroup](https://forum.cursor.com/u/LARAMediaGroup)\
**Post date:** [August 5, 2025, 1:23pm UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/19 "2025-08-05T13:23:35Z")

</div>

No, it kind of works now with the same API, but I’m getting a new error after each completed prompt, see attached.

 ![Screenshot 2025-08-05 at 14.23.17](https://us1.discourse-cdn.com/cursor1/original/3X/0/1/0178a074b37794ac277b294c820ea32ea04e32c9.png)

UPDATE: it throws this error only when editing files.

If we’re just chatting, it works like a charm.

As soon as it edits a line of code, that error appears instantly.

---

<div class="post-metadata">

**Author:** ![LARAMediaGroup](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/laramediagroup/32/58850_2.png) [@LARAMediaGroup](https://forum.cursor.com/u/LARAMediaGroup)\
**Post date:** [August 5, 2025, 2:31pm UTC](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686/20 "2025-08-05T14:31:31Z")

</div>

Here’s a collection of the errors we get while using our API. The “solution” is ‘please continue’, and it continues to work. Wonder if you can have a look at Cursor and stop these unnecessary messages from popping up?

 ![Screenshot 2025-08-05 at 14.33.45](https://us1.discourse-cdn.com/cursor1/original/3X/3/5/351f523ad1bbed75eeba4166fd69b9fb7743794c.png)

 ![Screenshot 2025-08-05 at 15.31.08](https://us1.discourse-cdn.com/cursor1/original/3X/5/1/51f13e317ba9ae4a447576c6922c6a24eaac3ae1.png)

 ![Screenshot 2025-08-05 at 16.50.26](https://us1.discourse-cdn.com/cursor1/original/3X/9/0/90bcdd71d8e9318e8afc0d1bb3b389046ae1913c.png)

 ![Screenshot 2025-08-05 at 17.11.59](https://us1.discourse-cdn.com/cursor1/original/3X/2/8/280193ef5f7ade0f0a1c8168b430afc8493d8aee.png)

[Next page](https://forum.cursor.com/t/use-cursor-with-open-source-llms/125686.md?page=2)
