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.

相关内容

热门资讯

分享一款!江汉晃晃辅助器,同城... 分享一款!江汉晃晃辅助器,同城510k修改,要领教程(有挂方式)1、每一步都需要思考,不同水平的挑战...
让我来分享经验!天天贵阳游戏辅... 让我来分享经验!天天贵阳游戏辅助,哥哥打大a有辅助吗,模板教程(有挂助手)1、不需要AI权限,帮助你...
玩家必看分享!龙岩优优辅助,衢... 玩家必看分享!龙岩优优辅助,衢州都莱辅助器,妙招教程(真的有挂)1、让任何用户在无需龙岩优优辅助安装...
终于懂了!手机游戏挂机辅助软件... 终于懂了!手机游戏挂机辅助软件,传送屋激k看底牌辅助软件,练习教程(有挂功能)进入游戏-大厅左侧-新...
玩家必看科普!胡乐情怀宜春外挂... 玩家必看科普!胡乐情怀宜春外挂,同城乐吧乐享版510k辅助,总结教程(有挂攻略)1、首先打开胡乐情怀...
推荐一款!微信三哥玩辅助器,浙... 推荐一款!微信三哥玩辅助器,浙江游戏大厅修改器,学习教程(有挂头条)该软件可以轻松地帮助玩家将微信三...
玩家攻略!凑一桌游戏软件下载辅... 玩家攻略!凑一桌游戏软件下载辅助,新518互游插件,法子教程(的确有挂)1、许多玩家不知道凑一桌游戏...
玩家爆料!湖北卡五星辅助软件,... 玩家爆料!湖北卡五星辅助软件,蜀山四川小程序破解版,练习教程(有挂详情)蜀山四川小程序破解版能透视中...
教程攻略!黑科技微乐小程序辅助... 教程攻略!黑科技微乐小程序辅助器免费,战神辅助官网,操作教程(有挂总结)该软件可以轻松地帮助玩家将黑...
重大推荐!随意玩辅助器视频有挂... 重大推荐!随意玩辅助器视频有挂,欢乐茶馆免费辅助设置,手册教程(发现有挂)随意玩辅助器视频有挂脚本下...