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.

相关内容

热门资讯

我来分享!微友辅助神器下载(辅... 我来分享!微友辅助神器下载(辅助挂)好像是真的有挂(详细辅助玩家教你);支持多人共享记分板与复盘,通...
4分钟辅助!老友麻将有没有挂(... 4分钟辅助!老友麻将有没有挂(辅助挂)可靠教程(本来有挂);人气非常高,ai更新快且高清可以动的一个...
第九分钟了解!新道游透视黑科技... 第九分钟了解!新道游透视黑科技(辅助挂)原来是真的有挂(详细辅助工具);玩家必备必赢加哟《13670...
最新研发"枫叶辅助脚... 最新研发"枫叶辅助脚本"枫叶辅助脚本(果然存在有挂)1、每一步都需要思考,不同水平的挑战会更加具有挑...
五分钟辅助器!潮汕掌上娱辅助科... 五分钟辅助器!潮汕掌上娱辅助科技(辅助挂)攻略教程(其实有挂)是一款可以让一直输的玩家,快速成为一个...
一分钟秒懂!友空互娱插件(辅助... 1、一分钟秒懂!友空互娱插件(辅助挂)果然是有挂(详细辅助教你攻略)。2、友空互娱插件透视辅助简单,...
第九分钟了解!斗棋bug辅助(... 第九分钟了解!斗棋bug辅助(辅助挂)一贯有挂(详细辅助攻略)1、玩家可以在斗棋bug辅助软件透明挂...
必知教程"新卡农辅助... 必知教程"新卡农辅助"新卡农辅助(一直是有挂);新卡农辅助软件透明挂微扑克wpk插件教程:1、微扑克...
3分钟辅助器!新518互游辅助... 3分钟辅助器!新518互游辅助(辅助挂)透视教程(原先真的是有挂)新518互游辅助辅助器中分为三种模...
玩家爆料!微乐陕西三代自建房挂... 玩家爆料!微乐陕西三代自建房挂(辅助挂)原先真的是有挂(详细辅助力荐教程);最新版2024是一款经典...