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、透视法子!大菠萝免...
透视课程!hhpoker俱乐部... 透视课程!hhpoker俱乐部是干嘛的,德州局HHpoker透视脚本(透视)都是真的是有脚本神器(哔...
透视学习!aapoker能控制... 透视学习!aapoker能控制牌吗,aapoker透视插件(透视)原来是真的脚本插件(哔哩哔哩)运a...
透视窍要!德普之星辅助工具如何... 透视窍要!德普之星辅助工具如何打开,德普之星辅助器怎么用(透视)竟然真的有透视技巧(哔哩哔哩)1、游...
透视方案!aapoker脚本,... 透视方案!aapoker脚本,aapoker真的假的(透视)其实真的有透视教程(哔哩哔哩)透视方案!...
透视模板!hhpoker辅助器... 您好,hhpoker辅助器这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302】很...
透视大纲!wepoker透视器... 透视大纲!wepoker透视器免费,we-poker辅助器(透视)确实有脚本挂(哔哩哔哩)在进入we...
透视项目!aapoker真的假... 透视项目!aapoker真的假的,aapoker辅助工具安全吗(透视)其实是真的脚本脚本(哔哩哔哩)...
透视指引!aapoker怎么开... 透视指引!aapoker怎么开辅助器,aapoker透视怎么用(透视)总是有透视脚本(哔哩哔哩);a...
透视策略!hhpoker德州透... 透视策略!hhpoker德州透视挂,hhpoker免费透视脚本(透视)好像是有脚本软件(哔哩哔哩)1...