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.

相关内容

热门资讯

黑科技辅助(微扑克)数据统计软... 黑科技辅助(微扑克)数据统计软件(透视)ai辅助器下载(从来真的有挂)1、很好的工具软件,可以解锁游...
第五分钟辅助挂(微扑克)ai辅... 第五分钟辅助挂(微扑克)ai辅助app(辅助挂)切实有挂(有挂讲解)-哔哩哔哩;所有人都在同一条线上...
黑科技系统(aa扑克辅助)外挂... 黑科技系统(aa扑克辅助)外挂透视辅助挂(透视)切实真的是有挂(黑科技脚本)-哔哩哔哩亲,关键说明,...
黑科技脚本!wepower伙牌... 黑科技脚本!wepower伙牌(透视)太坑了存在有挂(存在挂教程黑科技详情)-哔哩哔哩所有人都在同一...
黑科技科技(AAPOker)辅... 黑科技科技(AAPOker)辅助软件叫什么(透视)透视辅助器(起初真的是有挂);原来确实真的有挂(需...
黑科技透明挂!wepoke到底... 黑科技透明挂!wepoke到底有没有挂,(wEpoke)原来是真的有挂,黑科技存在(存在有挂)-哔哩...
黑科技辅助挂(wepoke透明... 黑科技辅助挂(wepoke透明挂怎么识别)外挂黑科技辅助助手(透视)果然是真的有挂(黑科技辅助)-哔...
黑科技玄学!微扑克ai机器人(... 黑科技玄学!微扑克ai机器人(黑科技ai)太坑了是有挂(可靠教程黑科技方法)-哔哩哔哩微扑克ai机器...
黑科技软件(wepoke)黑科... 黑科技软件(wepoke)黑科技(黑科技)作弊器(其实真的是有挂);小薇(透视辅助)致您一封信;亲爱...
黑科技插件!wepokeai代... 黑科技插件!wepokeai代打辅助,(wepoke)原来真的有挂,黑科技私人房(有挂神器)-哔哩哔...