Why can‘t I access GPT-4 models via API, although GPT-3.5 models work?
创始人
2025-01-10 16:04:31
0

题意:为什么我无法通过API访问GPT-4模型,尽管GPT-3.5模型可以工作?

问题背景:

I'm able to use the gpt-3.5-turbo-0301 model to access the ChatGPT API, but not any of the gpt-4 models. Here is the code I am using to test this (it excludes my openai API key). The code runs as written, but when I replace "gpt-3.5-turbo-0301" with "gpt-4", "gpt-4-0314", or "gpt-4-32k-0314", it gives me an error

openai.error.InvalidRequestError: The model: `gpt-4` does not exist 

I have a ChatGPT+ subscription, am using my own API key, and can use gpt-4 successfully via OpenAI's own interface.

It's the same error if I use gpt-4-0314 or gpt-4-32k-0314. I've seen a couple articles claiming this or similar code works using 'gpt-4' works as the model specification, and the code I pasted below is from one of them.

Is it possible to access the gpt-4 model via Python + API, and if so, how?

openai_key = "sk..." openai.api_key = openai_key system_intel = "You are GPT-4, answer my questions as if you were an expert in the field." prompt = "Write a blog on how to use GPT-4 with python in a jupyter notebook" # Function that calls the GPT-4 API  def ask_GPT4(system_intel, prompt):      result = openai.ChatCompletion.create(model="gpt-3.5-turbo-0301",                                  messages=[{"role": "system", "content": system_intel},                                            {"role": "user", "content": prompt}])     print(result['choices'][0]['message']['content'])  # Call the function above ask_GPT4(system_intel, prompt)

问题解决:

Currently the GPT 4 API is restricted, Even to users with a Chat GPT + subscription.

You may need to join the Waitlist for the API.

相关内容

热门资讯

一秒答解!aapoker辅助工... 您好,这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302】很多玩家在这款游戏中打...
科普!边锋老友圈怎么开辅助,h... 科普!边锋老友圈怎么开辅助,hhpoker是真的还是假的,高科技教程(有挂细节)-哔哩哔哩;边锋老友...
详细一下!小南四川长牌辅助,w... 详细一下!小南四川长牌辅助,wepoker辅助脚本,都是真的是有挂(哔哩哔哩)1、每一步都需要思考,...
推荐几款新版!拱趴大菠萝机器人... 推荐几款新版!拱趴大菠萝机器人,we-poker辅助软件教程,其实真的有挂(真的有挂)1、免费辅助多...
研究成果!wepoker破解版... 研究成果!wepoker破解版内购,wpk透视插件,普及教程(有挂分析)-哔哩哔哩;亲真的是有正版授...
科普一下!福建大玩家十三水辅助... 科普一下!福建大玩家十三水辅助,陕麻圈脚本辅助,一贯存在有挂(哔哩哔哩)1、上手简单,内置详细流程视...
必知教程!wpk辅助器是真的吗... 必知教程!wpk辅助器是真的吗,hhpoker开挂教程,切实真的有挂(有挂猫腻)破解侠是真的助透视。...
科技介绍!拱趴大菠萝技巧,红龙... 科技介绍!拱趴大菠萝技巧,红龙poker辅助平台,系统教程(发现有挂)-哔哩哔哩;拱趴大菠萝技巧AI...
解谜一下!乐平包王讨赏辅助,逸... 解谜一下!乐平包王讨赏辅助,逸趣鄱阳翻精辅助,原来是真的有挂(哔哩哔哩)1.乐平包王讨赏辅助 选牌创...
信息共享!德州透视插件,wep... 信息共享!德州透视插件,wepoker私人局辅助器怎么用,果然是真的有挂(真实有挂)1、wepoke...