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.

相关内容

热门资讯

曝光秘籍!海商娱乐辅助器,we... 曝光秘籍!海商娱乐辅助器,wepoker辅助脚本,详细教程(有挂存在)1、进入游戏-大厅左侧-新手福...
七分钟辅助!wepoker怎么... 七分钟辅助!wepoker怎么设置房间,aapoker能控制牌吗,详细教程(有挂解惑)在进入wepo...
一分钟揭秘!hhpoker辅助... 一分钟揭秘!hhpoker辅助器,亲友联盟能开挂不,总结教程(证实有挂)1、打开软件启动之后找到中间...
了解手册!广东雀神智能插件是真... 了解手册!广东雀神智能插件是真有挂,山西扣点免费辅助下载,详细教程(确实有挂)1、下载好广东雀神智能...
第8分钟辅助!aapoker发... 第8分钟辅助!aapoker发牌逻辑,哈糖大菠萝有挂吗,详细教程(有挂神器)1、超多福利:超高返利,...
发现一款!德州真人透视脚本,上... 发现一款!德州真人透视脚本,上饶中至辅助软件怎么用,机巧教程(真实有挂)1、起透看视 上饶中至辅助软...
普及法门!广东雀神麻雀辅助神器... 普及法门!广东雀神麻雀辅助神器,越乡游义乌辅助器免费试用,详细教程(证实有挂)1、起透看视 广东雀神...
第八分钟辅助!wepokerp... 第八分钟辅助!wepokerplus透视脚本免费,WePOker有没有透视方法,详细教程(了解有挂)...
此事备受玩家关注!hhpoke... 此事备受玩家关注!hhpoker为什么一直输,闲闲辅助器,练习教程(证实有挂)1.闲闲辅助器 选牌创...
推荐讲义!新超凡软甲辅助,微信... 推荐讲义!新超凡软甲辅助,微信开心泉州辅助,详细教程(有挂秘诀)新超凡软甲辅助透视方法中分为三种模型...