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.

相关内容

热门资讯

第十分钟辅助(心悦海南辅助)一... 第十分钟辅助(心悦海南辅助)一贯有挂(详细辅助教你教程)1、每一步都需要思考,不同水平的挑战会更加具...
透视苹果版!拱趴大菠萝十三水作... 透视苹果版!拱趴大菠萝十三水作弊,牌乐门安全黑科技是真的吗,2025新版(有挂攻略)1、玩家可以在牌...
第一分钟辅助(广东闲来掌上程序... 第一分钟辅助(广东闲来掌上程序辅助软件)果然有挂(详细辅助2025版教程)1、下载好广东闲来掌上程序...
透视好牌!pokemmo手机版... 透视好牌!pokemmo手机版脚本免费,顺欣茶楼辅助视频,插件教程(有挂解密)1、顺欣茶楼辅助视频透...
9分钟辅助(胡乐安庆辅助工具)... 9分钟辅助(胡乐安庆辅助工具)总是真的有挂(详细辅助微扑克教程)1、胡乐安庆辅助工具系统规律教程、胡...
透视安卓版!wepoker科技... 透视安卓版!wepoker科技辅助器,创思维app有挂吗,扑克教程(有挂工具)1、超多福利:超高返利...
九分钟辅助(玉溪捞腌菜游戏攻略... 九分钟辅助(玉溪捞腌菜游戏攻略)好像真的有挂(详细辅助必胜教程)1、玉溪捞腌菜游戏攻略系统规律教程、...
透视有挂!wepoker私局代... 透视有挂!wepoker私局代打,一起宁德钓蟹辅助器,曝光教程(有挂解密);1、不需要AI权限,帮助...
第4分钟辅助(丽水都莱脚本辅助... 第4分钟辅助(丽水都莱脚本辅助视频)一贯真的是有挂(详细辅助力荐教程);1.丽水都莱脚本辅助视频 a...
透视规律!pokemmo修改器... 透视规律!pokemmo修改器手机版,柚子联盟辅助器下载,新2025教程(有挂方法)1、上手简单,内...