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养号规律,广东雀神智能插件安装价格,科技教程(有挂攻略);1)广东雀神智能插...
透视插件!wepoker透视脚... 透视插件!wepoker透视脚本苹果(透视)外挂透明挂辅助app(好像真的有挂)1、许多玩家不知道w...
透视模拟器!wpk辅助器是真的... 透视模拟器!wpk辅助器是真的吗(透视)AI教程(竟然真的有挂)所有人都在同一条线上,像星星一样排成...
透视规律!wepoker俱乐部... 透视规律!wepoker俱乐部辅助,小程序跑得快的辅助,2025版教程(有挂辅助)一、小程序跑得快的...
透视能赢!aapoker辅助功... 透视能赢!aapoker辅助功能(透视)外挂透明挂辅助工具(总是真的是有挂);1. ai辅助创建新账...
透视ai!wepoker透视脚... 透视ai!wepoker透视脚本网页(透视)必胜教程(真是真的有挂)1、wepoker透视脚本网页机...
最新研发“四川途游辅助软件下载... 最新研发“四川途游辅助软件下载”拱趴大菠萝万能辅助器(从前是真的有挂);致您一封信;亲爱四川途游辅助...
透视玄学!佛手大菠萝有挂吗,新... 透视玄学!佛手大菠萝有挂吗,新道游正版辅助,详细教程(有挂插件)1、很好的工具软件,可以解锁游戏的新...
透视智能ai!德普之星辅助器a... 透视智能ai!德普之星辅助器app(透视)外挂透明挂辅助脚本(最初有挂),支持语音通讯、好友开房及战...
透视辅助!wpk脚本下载(透视... 透视辅助!wpk脚本下载(透视)透明教程(真是是真的有挂)1、起透看视 wpk脚本下载透明视辅助2、...