zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
39.32k stars 2.04k forks source link

chatgpt wont work even after redoing api-key multiple times correctly #9702

Open elamien opened 3 months ago

elamien commented 3 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

im not sure if i need to pay for token or not but gpt 3 is free, and i also see response/token left in the top right for both gpt3 and gpt4, yet everywhere gpt fails.

Environment

macbook air m1 Sonoma 14.4

If applicable, add mockups / screenshots to help explain present your vision of the feature

Screenshot 2024-03-22 at 10 24 48 AM

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

rgbkrk commented 3 months ago

Run it again and see what's in your Zed.log, likely in ~/Library/Logs/Zed/Zed.log. If I had to guess, your API key is being rejected by OpenAI. Might be worth checking in on your key usage/billing on platform.openai.com.

Moshyfawn commented 3 months ago

You can do a sanity check by running

export OPENAI_API_KEY = <your-openai-token-goes-here>

curl https://api.openai.com/v1/chat/completions   -H "Content-Type: application/json"   -H "Authorization: Bearer $OPENAI_API_KEY"   -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "system",
        "content": "PING"
      }
    ]
  }'

See if you get an error that would explain the issue.

Smotrov commented 3 months ago

I have the same story. I have ChatGPT Plus Subscription. Should I also pay for an OpenAI API subscription to get it work?

Moshyfawn commented 3 months ago

I have the same story. I have ChatGPT Plus Subscription. Should I also pay for an OpenAI API subscription to get it work?

Unfortunately, this is the case when using the OpenAI API; the credits are not included with the ChatGPT Plus subscription.

notpeter commented 2 weeks ago

Just following up @elamien, were you able to get your OpenAI API token working?

im not sure if i need to pay for token or not but gpt 3 is free

My understanding is that all OpenAPI API calls incur expenses, GPT3.5 is cheaper than GPT-4, but still requires you to configure billing and add credit to your account.