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.

相关内容

热门资讯

细节辅助!新九哥破解版,小闲川... 小闲川南怎么辅助 无需打开直接搜索微信:136704302本司针对手游进行,选择我们的四大理由: 1...
辅助教程开挂!陕麻圈插件注入,... 您好:陕麻圈插件注入这款游戏可以开挂的,确实是有挂的,很多玩家在这款游戏中打牌都会发现很多用户的牌特...
玩家教程开挂!雀友会广东潮汕麻... 玩家教程开挂!雀友会广东潮汕麻雀开挂,新上游大厅修改器(分享给玩家开挂辅助下载)【无需打开直接搜索加...
正品辅助!钱塘十水三辅助,牵手... 正品辅助!钱塘十水三辅助,牵手跑辅助,透视苹果版开挂(有挂功能)《详细加薇136704302咨询》游...
必备教程辅助!多乐辅助下载,新... 新二号辅助软件多少钱是一款可以让一直输的玩家,快速成为一个“必胜”的ai辅助神器,有需要的用户可以加...
发现辅助!欢乐达人暗宝脚本,大... 您好:欢乐达人暗宝脚本这款游戏可以开挂的,确实是有挂的,很多玩家在这款游戏中打牌都会发现很多用户的牌...
透明挂教程!开挂!捉住捣蛋鸡辅... 透明挂教程!开挂!捉住捣蛋鸡辅助码,新导游科技透视免费版(透视攻略开挂辅助神器);无需打开直接搜索加...
传授辅助!泸州大二辅助,微信卡... 微信卡五星辅助 无需打开直接搜索微信:136704302本司针对手游进行,选择我们的四大理由: 1、...
AI教程开挂!小程序能开挂吗,... AI教程开挂!小程序能开挂吗,微信小程序开心十三张脚本(玩家必备教程开挂辅助工具)>>您好:软件加薇...
推荐辅助!威信茶馆解码器,神武... 您好:这款威信茶馆解码器游戏是可以开挂的,确实是有挂的,很多玩家在这款威信茶馆解码器游戏中打牌都会发...