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“wpk透视插件”详细... 透视ai“wpk透视插件”详细透视辅助开挂透明教程-确实真的是有挂1、进入游戏-大厅左侧-新手福利-...
黑科技辅助!aapoker可以... 黑科技辅助!aapoker可以开挂吗(辅助挂)太离谱了果然是真的有挂(2025已更新)(哔哩哔哩)运...
科普常识“至友互娱情怀app抚... 科普常识“至友互娱情怀app抚州软件”太嚣张了透视辅助开挂透明挂教程-其实有挂暗藏猫腻,小编详细说明...
黑科技辅助(wepoke智能a... 1、黑科技辅助(wepoke智能ai)wepoke软件透明挂存在(透视)教你教程(2023已更新)(...
透视有挂“哈糖大菠萝有没有挂”... 透视有挂“哈糖大菠萝有没有挂”详细透视辅助开挂可靠技巧-竟然是真的有挂1、不需要AI权限,帮助你快速...
黑科技软件!wepoke真的有... 黑科技软件!wepoke真的有挂嘛(智能ai)太嚣张了一直存在有挂(2026已更新)(哔哩哔哩)1、...
黑科技辅助(wepoke智能a... 黑科技辅助(wepoke智能ai)微扑克辅助插件挂(透视)科技教程(2025已更新)(哔哩哔哩)1、...
技巧知识分享“微友圈app辅助... 技巧知识分享“微友圈app辅助工具”太坑了透视辅助开挂解说技巧-确实是真的有挂;1、首先打开微友圈a...
透视肯定“悦扑克脚本”详细透视... 透视肯定“悦扑克脚本”详细透视辅助开挂微扑克教程-切实是有挂;1、超多福利:超高返利,海量正版游戏,...
黑科技私人局!哈糖大菠萝有外挂... 黑科技私人局!哈糖大菠萝有外挂吗(辅助挂)太坑了确实存在有挂(2024已更新)(哔哩哔哩)1、哈糖大...