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.

相关内容

热门资讯

黑科技辅助!(AAPOKer)... 黑科技辅助!(AAPOKer)竟然是有挂,(aapOker)确实是真的有挂,新2025教程(有挂黑科...
一分钟了解!皮皮胡子辅助(辅助... 一分钟了解!皮皮胡子辅助(辅助挂)一向真的有挂(详细辅助新2025版);亲真的是有正版授权,小编(透...
第二分钟了解!掌酷十三张透视辅... 第二分钟了解!掌酷十三张透视辅助免费(辅助挂)好像是有挂(详细辅助工具)1、不需要AI权限,帮助你快...
玩家必看攻略"边锋跑... 玩家必看攻略"边锋跑的快外挂免费"边锋跑的快外挂免费(确实是真的有挂)1、每一步都需要思考,不同水平...
黑科技辅助!we-poker软... 黑科技辅助!we-poker软件透明挂,(wepoKE)透明挂到底有没有挂,德州论坛(有挂技巧)1、...
让我来分享经验!对战互娱有辅助... 让我来分享经验!对战互娱有辅助吗(辅助挂)好像真的是有挂(详细辅助技巧教程);亲真的是有正版授权,小...
第四分钟了解!多乐跑如何增加胜... 第四分钟了解!多乐跑如何增加胜率吧(辅助挂)竟然是真的有挂(详细辅助插件);1.多乐跑如何增加胜率吧...
重大来袭"欢乐茶馆怎... 重大来袭"欢乐茶馆怎么能赢"欢乐茶馆怎么能赢(真是有挂)1、首先打开欢乐茶馆怎么能赢最新版本,在欢乐...
黑科技辅助!(AaPOKER)... 黑科技辅助!(AaPOKER)切实有挂,(AAPOKEr)总是是有挂,辅助教程(有挂助手)1、用户打...
发现玩家!金杯竞技辅助(辅助挂... 自定义金杯竞技辅助系统规律,只需要输入自己想要的开挂功能,一键便可以生成出微扑克专用辅助器,不管你是...