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.

相关内容

热门资讯

透视科技!德普之星有辅助软件(... 透视科技!德普之星有辅助软件(透视)底牌透视挂辅助神器(可靠开挂辅助软件教程)-哔哩哔哩是一款可以让...
透视规律!hhpoker真的假... 透视规律!hhpoker真的假的(透视)底牌透视挂辅助插件(可靠开挂辅助2025新版技巧)-哔哩哔哩...
透视科技!哈糖大菠萝可以开挂(... 《透视科技!哈糖大菠萝可以开挂(透视)底牌透视挂辅助机器人(可靠开挂辅助德州论坛)-哔哩哔哩》 哈糖...
透视软件!wpk俱乐部是真的(... 您好:wpk俱乐部是真的这款游戏可以开挂的,确实是有挂的,很多玩家在这款游戏中打牌都会发现很多用户的...
透视好友房!aapoker如何... 透视好友房!aapoker如何设置胜率(透视)底牌透视挂辅助底牌(可靠开挂辅助微扑克教程)-哔哩哔哩...
透视好友!hhpoker是真的... 透视好友!hhpoker是真的还是假的(透视)底牌透视挂辅助器(可靠开挂辅助解密教程)-哔哩哔哩;1...
透视安卓版!wepoker手机... 您好:wepoker手机助手这款游戏可以开挂的,确实是有挂的,很多玩家在这款游戏中打牌都会发现很多用...
透视神器!aapoker辅助工... 透视神器!aapoker辅助工具安全(透视)底牌透视挂辅助系统(可靠开挂辅助必胜教程)-哔哩哔哩;a...
透视了解!aapoker可以设... 透视了解!aapoker可以设置提高好牌几率(透视)底牌透视挂辅助插件(可靠开挂辅助教你攻略)-哔哩...
透视肯定!wepoker黑侠辅... 透视肯定!wepoker黑侠辅助器(透视)底牌透视挂辅助脚本(可靠开挂辅助AA德州教程)-哔哩哔哩;...