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.

相关内容

热门资讯

透视美元局!wepoker透视... 此外,数据分析德州(wepoker透视脚本免费下载)辅助神器app还具备辅助透视行为开挂功能,通过对...
透视最新“wpk辅助器下载”真... 透视最新“wpk辅助器下载”真是有挂(辅助挂)详细辅助AI教程所有人都在同一条线上,像星星一样排成一...
透视私人局!wepoker有没... 透视私人局!wepoker有没有插件,牵手辅助神器下载,透明教程(有挂详情);1、牵手辅助神器下载a...
wepoker透视底牌脚本!h... wepoker透视底牌脚本!hhpoker辅助软件下载,wepoker透视(详细辅助黑科技教程);是...
透视辅助!pokemmo手机脚... 透视辅助!pokemmo手机脚本,福建兄弟13水插件(都是真的是有挂)1、福建兄弟13水插件透视辅助...
透视智能ai!wepoker辅... 透视智能ai!wepoker辅助器是真的的吗,智星菠萝有挂吗(详细辅助新2025版);玩家必备必赢加...
透视有挂“德普之星怎么作弊”一... 透视有挂“德普之星怎么作弊”一直是有挂(辅助挂)详细辅助科技教程暗藏猫腻,小编详细说明原来是有挂(透...
hhpoker透视功能如何下载... hhpoker透视功能如何下载!wpk私人局辅助是真的吗,wpk辅助软件多少钱一个(详细辅助必胜教程...
透视好友房!werplan怎么... 透视好友房!werplan怎么透视,四川家园辅助,透明挂教程(有挂介绍);1、不需要AI权限,帮助你...
透视有挂!wepoker有透视... 透视有挂!wepoker有透视功能吗,开心泉州免费辅助器(原来真的有挂)所有人都在同一条线上,像星星...