cursor icon indicating copy to clipboard operation
cursor copied to clipboard

Using GPT-4 with an OpenAI API Key

Open arhatcn opened this issue 1 year ago • 4 comments

arhatcn avatar Mar 31 '23 01:03 arhatcn

I also like this proposal.

AiguoYan avatar Mar 31 '23 19:03 AiguoYan

Like this idea. Hope to hear from the develper team soon.

longfuxu avatar Apr 01 '23 12:04 longfuxu

I also have the same proposal.

JaRLenZhang avatar Apr 07 '23 03:04 JaRLenZhang

This should already be possible, according to the devs, but I can't say I know how it would be done as I don't use an API key myself.

If anyone's having issues with this still, let us know

danperks avatar Apr 15 '23 07:04 danperks

This is not working for me. I am unable to select gpt-4 in any capacity using an openai api key.

overage-waif-cocoon avatar Jul 27 '23 03:07 overage-waif-cocoon

Note that when I ask Cursor itself "Can I use GPT-4 with my own API key in Cursor?", it says:

Yes, you can use GPT-4 with your own API key in Cursor. You just need to set up your API key in the settings of Cursor. Here's how you can do it:

  1. Open the settingseditor file.
  2. Look for the section related to GPT-4.
  3. You should see a field for the API key. Enter your API key there.
  4. Save the changes and close the file.

Now, Cursor should use your API key when making requests to GPT-4. Please note that the exact steps might vary depending on the version of Cursor you're using. If you can't find the settings, please refer to the documentation or contact the support.

samj avatar Aug 14 '23 14:08 samj

What is the settingseditor file?

In settings there appears to be no obvious slot to enter the API key, settings.json also doesn't contain any field relating to API keys.

glasgowm148 avatar Aug 17 '23 10:08 glasgowm148

It took me longer than it should have to work this out but there's a gear at the top right… they may want to fix that even if just by replicating those settings in the main settings dialogs.

Sent via Superhuman ( @.*** )

On Thu, Aug 17, 2023 at 12:43:13, Mark Glasgow < @.*** > wrote:

What is the settingseditor file?

In settings there appears to be no obvious slot to enter the API key, settings.json also doesn't contain any field relating to API keys.

— Reply to this email directly, view it on GitHub ( https://github.com/getcursor/cursor/issues/394#issuecomment-1682054831 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AAFRIEX4HH7YGEUBL2TDTZTXVXYUDANCNFSM6AAAAAAWOAK22E ). You are receiving this because you are subscribed to this thread. Message ID: <getcursor/cursor/issues/394/1682054831 @ github. com>

samj avatar Aug 17 '23 13:08 samj

Thanks, I had just found it myself and came here to post the solution 😅

glasgowm148 avatar Aug 17 '23 14:08 glasgowm148

Where is this elusive gear in the top right ?

Screenshot 2023-08-22 at 11 45 20

Nicholas0350 avatar Aug 22 '23 08:08 Nicholas0350

Can't find the gear icon in the top right, also there's no GPT-4 section in settings

PajkeGit avatar Aug 22 '23 11:08 PajkeGit

Can't find the gear icon in the top right, also there's no GPT-4 section in settings

cmd + shift + J

sigreyo avatar Aug 22 '23 14:08 sigreyo

I have access to the GPT-4 API
image

...and have set my own key.
Yet Cursor only makes GPT-3.5 available??
image

Why? How can I enable GPT-4? Am I missing something basic here?

sgerogia avatar Aug 23 '23 12:08 sgerogia

image

sidsarasvati avatar Aug 23 '23 18:08 sidsarasvati

That's it! You have to minimize the window

mandrade2 avatar Aug 25 '23 00:08 mandrade2

Was this resolved? You can use gpt4 now?

eonist avatar Sep 20 '23 21:09 eonist

Is there no way to use GPT4? with my own ChatGPT plus account?

eonist avatar Sep 20 '23 21:09 eonist

For anyone interested: this has been resolved for me. See the community topic I also raised: https://forum.cursor.sh/t/enabling-gpt-4-in-cursor-using-own-key/140

sgerogia avatar Sep 21 '23 06:09 sgerogia

The dance didn't work for me. My observation: I'm not sure it fixes it but, I just discovered that I have chatgpt plus. Which is not the right package for a gpt4 key. I need to pay for that As I go. Have not payed for it yet, but will in a few days. Just have to get the company card etc. Will report back if that changes things.

eonist avatar Sep 21 '23 13:09 eonist

image

I used to see a "Model" section in there. Just like @sgerogia. It's gone now. What's going on?

pbrisson avatar Oct 10 '23 12:10 pbrisson

For me it was that I had the wrong payment structure at openAI. I paid for chat gpt plus. But I had to get the pay as you go plan that gets you the GPT4 key.

eonist avatar Oct 11 '23 05:10 eonist

@eonist Thanks for your follow-up. I already had the pay as you go plan. My cursor was working fine with GPT-4 as of last friday. I updated yesterday morning and this is when weird things started to happen. As you can see on the screenshot above, I can't even select the model. Typing my key doesn't do anything. Clicking on the arrow next to the textbox doesn't do anything. Toggling the "Using key" option on and off doesn't do anything. Uninstalling / Reinstalling won't fix it either.

pbrisson avatar Oct 11 '23 12:10 pbrisson

Since using GPT-4 within my IDE is the main reason why I switched to Cursor, it is mandatory for me get back to a version that supports that feature. I had the Windows binary for 0.7.3 handy in my Downloads folder and confirm downgrading fixes the issue. I made it available here if it can help anyone: https://github.com/pbrisson/cursor/releases/tag/0.7.3

pbrisson avatar Oct 11 '23 12:10 pbrisson

@pbrisson You can control the model in chat or Cmd-k. Do you see gpt-4 in the dropdown?

Screenshot 2023-10-11 at 11 15 06 PM

truell20 avatar Oct 11 '23 22:10 truell20

Thanks @truell20 - I'm speechless!

Never saw that I could use it from there! I confirm I can select gpt-4 from there (both Cmd-k and Cmd-l) and that everything seems to be working. I will report if I stumble upon anything else.

(P.S. I don't have the ability to do it, but I think this issue can be closed as @eonist provided a solution as well.)

pbrisson avatar Oct 12 '23 11:10 pbrisson

Looks like all issues in here have been resolved, and the initial feature has been implemented, so I will close this issue. Thank you for your suggestion!

jakobFNF avatar Oct 19 '23 21:10 jakobFNF

For me it was that I had the wrong payment structure at openAI. I paid for chat gpt plus. But I had to get the pay as you go plan that gets you the GPT4 key.

How do you change the plan? I can't see the option anywhere

paddymccallan-izon avatar Oct 30 '23 15:10 paddymccallan-izon

  1. settingseditor

OMG it took me ages to find the icon too.

MichaelReaNZ avatar Nov 30 '23 00:11 MichaelReaNZ