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.

相关内容

热门资讯

不少玩家反映!微信微乐游戏辅助... 不少玩家反映!微信微乐游戏辅助器,微乐小程序黑科技,手筋教程(有挂app)-哔哩哔哩该软件可以轻松地...
透视了解!aapoker怎么控... 透视了解!aapoker怎么控制牌(透视)hhpoker买挂-总是真的有挂(哔哩哔哩)1、玩家可以在...
九分钟插件!微信小程序微乐自建... 九分钟插件!微信小程序微乐自建房脚本下载,微乐小程序免费黑科技,阶段教程(有挂修改器)-哔哩哔哩所有...
据监测!微乐小程序免费黑科技在... 据监测!微乐小程序免费黑科技在线下载,微乐小程序黑科技,资料教程(有挂辅助器)-哔哩哔哩1、操作简单...
2026版复盘!德普之星透视免... 2026版复盘!德普之星透视免费(透视)德普之星透视辅助软件激活码-原来是有挂(哔哩哔哩)1、该软件...
第6分钟辅助!微乐家乡小程序辅... 第6分钟辅助!微乐家乡小程序辅助,微乐小程序免费黑科技,绝活教程(有挂app)-哔哩哔哩1、金币登录...
据了解!微乐家乡游戏攻略,微乐... 据了解!微乐家乡游戏攻略,微乐小程序黑科技,经验教程(有挂脚本)-哔哩哔哩1、每一步都需要思考,不同...
据悉!aapoker辅助器是真... 据悉!aapoker辅助器是真的吗(透视)hhpoker怎么破解-竟然真的有挂(哔哩哔哩)亲,关键说...
三分钟辅助!微乐自建房免费黑科... 三分钟辅助!微乐自建房免费黑科技推荐,微乐小程序免费黑科技,手册教程(有挂平台)-哔哩哔哩1、在微乐...
透视ai!微乐小程序晃晃脚本,... 透视ai!微乐小程序晃晃脚本,微乐小程序免费黑科技,要领教程(有挂插件)-哔哩哔哩一、微乐小程序免费...