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.

相关内容

热门资讯

9分钟了解!浙江宝宝游戏辅助软... 9分钟了解!浙江宝宝游戏辅助软件!果然是真的有辅助工具(有挂透视)-哔哩哔哩小薇(辅助器软件下载)致...
透视挂!陕麻圈辅助器透视开挂&... 透视挂!陕麻圈辅助器透视开挂"详细辅助神器"原来真的是有挂(哔哩哔哩)1、完成陕麻圈辅助器透视开挂有...
第十分钟了解!丽水都莱有辅助吗... 第十分钟了解!丽水都莱有辅助吗!好像真的有辅助教程(发现有挂)-哔哩哔哩1、完成丽水都莱有辅助吗辅助...
2026版复盘!皮皮山西挖坑辅... 2026版复盘!皮皮山西挖坑辅助"普及辅助挂"真是真的是有挂(哔哩哔哩)进入游戏-大厅左侧-新手福利...
第2分钟了解!新九哥辅助工具!... 第2分钟了解!新九哥辅助工具!一贯有辅助攻略(有挂教学)-哔哩哔哩1、下载好新九哥辅助工具脚本下载之...
刚刚!微乐广西麻辣辅助器&qu... 刚刚!微乐广西麻辣辅助器"曝光辅助插件"其实是真的有挂(哔哩哔哩)1、打开软件启动之后找到中间准星的...
第八分钟了解!心悦俱乐部游戏辅... 第八分钟了解!心悦俱乐部游戏辅助!本来是真的有辅助神器(真的有挂)-哔哩哔哩1、第八分钟了解!心悦俱...
截至目前!小闲川南手游辅助器&... 截至目前!小闲川南手游辅助器"解密辅助攻略"一直确实有挂(哔哩哔哩)1、小闲川南手游辅助器免费脚本咨...
第7分钟了解!德州私人局脚本!... 第7分钟了解!德州私人局脚本!原来是有辅助app(有挂教程)-哔哩哔哩;1、完成德州私人局脚本辅助器...
第三方辅助挂!多乐手游辅助软件... 第三方辅助挂!多乐手游辅助软件"解密辅助器"本来存在有挂(哔哩哔哩)第三方辅助挂!多乐手游辅助软件"...