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.

相关内容

热门资讯

实测辅助!wepoker有透视... 实测辅助!wepoker有透视底牌吗,闲来辅助平台,开挂(透视)辅助软件(真是有挂);亲真的是有正版...
正品辅助!wepoker透视版... 正品辅助!wepoker透视版下载,小程序财神十三张祈福,开挂(透视)辅助安装(真的有挂);致您一封...
盘点开挂!xpoker辅助神器... 盘点开挂!xpoker辅助神器,神兽互娱辅助免费,开挂(透视)辅助软件(有挂详情);人气非常高,ai...
分享开挂!wepoker-h5... 【福星临门,好运相随】;分享开挂!wepoker-h5下载,都莱软件安装辅助,开挂(透视)辅助工具(...
通报开挂!wepoker高级辅... 通报开挂!wepoker高级辅助,熊猫四川血战到底辅助,开挂(透视)辅助工具(确实有挂);熊猫四川血...
盘点开挂!hhpoker真的假... 盘点开挂!hhpoker真的假的,玄龙辅助工具,开挂(透视)辅助下载(有挂技术);玄龙辅助工具中的1...
了解开挂!hhpoker哪个俱... 了解开挂!hhpoker哪个俱乐部靠谱,胡乐胡乐辅助脚本可靠吗,开挂(透视)辅助神器(有挂方法);胡...
关于开挂!wepoker代打辅... 关于开挂!wepoker代打辅助,决战卡五星辅助神器,开挂(透视)辅助神器(有挂规律);亲真的是有正...
通报辅助!wepoker有没有... 通报辅助!wepoker有没有挂,福建天天开心辅助器真的假的,开挂(透视)辅助脚本(有挂实锤);是一...
详细辅助!德普之星透视辅助软件... 详细辅助!德普之星透视辅助软件激活码,友友联盟破解版下载,开挂(透视)辅助安装(有挂存在);友友联盟...