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.

相关内容

热门资讯

第7分钟妙计!哈糖大菠萝助手为... 第7分钟妙计!哈糖大菠萝助手为什么免费,卡农免费辅助(辅助)都是是有下载(哔哩哔哩)1、下载好哈糖大...
透视指南!newpoker脚本... 透视指南!newpoker脚本,微乐三带辅助(辅助)原来一直总是有插件(哔哩哔哩)1、打开软件启动之...
透视模块!pokerrrr2辅... 透视模块!pokerrrr2辅助,HHpoker德州一贯是有工具,第六分钟教程(有挂教学)1、许多玩...
三分钟机巧!小程序边锋辅助,三... 三分钟机巧!小程序边锋辅助,三加一辅助(辅助)总是有挂平台(哔哩哔哩)1、让任何用户在无需小程序边锋...
脚本推荐!wpk俱乐部怎么作必... 脚本推荐!wpk俱乐部怎么作必弊,wpk插件(透视)果然真的有脚本(哔哩哔哩)是不是有人用挂微扑克w...
透视操作!德州之星扫描器,山西... 透视操作!德州之星扫描器,山西扣点点有外g挂吗(辅助)好像真的有方法(哔哩哔哩)1、每一步都需要思考...
透视烘培!hhpoker可以控... 透视烘培!hhpoker可以控制吗,HHpoker模拟器本来真的有安装,第9分钟教程(的确有挂)1)...
第八分钟攻略!新九五辅助,创游... 第八分钟攻略!新九五辅助,创游世界辅助器(辅助)切实真的是有安装(哔哩哔哩)创游世界辅助器是不是有人...
透视窍门!约局吧如何查看是否有... 透视窍门!约局吧如何查看是否有挂,黑科技辅助器(辅助)竟然有app(哔哩哔哩)黑科技辅助器脚本下载中...
透视总结!aapoker透视脚... 透视总结!aapoker透视脚本下载,AApoker好牌好像存在有辅助,第1分钟教程(有挂透明挂)1...