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、进入到桂林字牌辅助科技...
有了最新消息!开心泉州小程序辅... 有了最新消息!开心泉州小程序辅助下载(辅助挂)一直真的有挂(正品开挂辅助安装)-哔哩哔哩该软件可以轻...
现场直击!雀神麻雀充运势用吗(... 现场直击!雀神麻雀充运势用吗(辅助挂)其实是有挂的(关于开挂辅助软件)-哔哩哔哩1、操作简单,无需注...
此事引发广泛关注!四川游戏家园... 此事引发广泛关注!四川游戏家园通用辅助在(辅助挂)原来真的是有挂(详细开挂辅助平台)-哔哩哔哩1、点...
经调查!微信新众游辅助(辅助挂... 经调查!微信新众游辅助(辅助挂)其实确实有挂(正品开挂辅助脚本)-哔哩哔哩1)微信新众游辅助辅助挂:...
值得注意的是!多乐找刺激脚本辅... 值得注意的是!多乐找刺激脚本辅助(辅助挂)其实真的是有挂(详细开挂辅助下载)-哔哩哔哩1、该软件可以...
今天上午!亲友联盟能开挂不(辅... 今天上午!亲友联盟能开挂不(辅助挂)其实真的有挂(发现开挂辅助插件)-哔哩哔哩在进入亲友联盟能开挂不...
刚刚!德州扑克游戏辅助器(辅助... 刚刚!德州扑克游戏辅助器(辅助挂)原来有挂(科技开挂辅助工具)-哔哩哔哩1、玩家可以在德州扑克游戏辅...
为了进一步!微乐家乡破解版(辅... 为了进一步!微乐家乡破解版(辅助挂)一贯真的是有挂(传授开挂辅助脚本)-哔哩哔哩暗藏猫腻,小编详细说...