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.

相关内容

热门资讯

终于清楚辅助!七七娱乐辅助AI... 终于清楚辅助!七七娱乐辅助AI插件,七七娱乐多功能一直真的有辅助插件1、完成七七娱乐有辅助插件,帮助...
一秒答解外挂!天天卡五星外挂A... 一秒答解外挂!天天卡五星外挂AI攻略,天天卡五星多功能本来真的是有外挂攻略1、操作简单,无需天天卡五...
玩家必备教程辅助器!心悦辽宁麻... 玩家必备教程辅助器!心悦辽宁麻将辅助器AIapp,心悦辽宁麻将多功能一直存在有辅助器app所有人都在...
重大来袭辅助器!残局斗地主辅助... 重大来袭辅助器!残局斗地主辅助器AI插件,残局斗地主多功能确实是有辅助器插件1、起透看视 残局斗地主...
盘点十款辅助!小熊猫麻将辅助A... 盘点十款辅助!小熊猫麻将辅助AI脚本,小熊猫麻将多功能果然是真的有辅助脚本小熊猫麻将脚本下载中分为三...
必看攻略辅助!创乐缘辅助AI技... 必看攻略辅助!创乐缘辅助AI技巧,创乐缘多功能原来真的有辅助技巧1、起透看视 创乐缘辅助软件价格2、...
重大通报透视挂!熊猫互娱透视挂... 重大通报透视挂!熊猫互娱透视挂AI插件,熊猫互娱多功能竟然有透视挂插件1、让任何用户在无需熊猫互娱安...
程序员教你辅助器!联众娱乐辅助... 程序员教你辅助器!联众娱乐辅助器AI技巧,联众娱乐多功能一贯有辅助器技巧1、联众娱乐免费辅助多个强度...
科普分享作弊器!推筒子作弊器A... 科普分享作弊器!推筒子作弊器AI插件,推筒子多功能原来是有作弊器插件所有人都在同一条线上,像星星一样...
一分钟揭秘开挂!牛大亨开挂AI... 一分钟揭秘开挂!牛大亨开挂AI攻略,牛大亨多功能真是真的有开挂攻略1、牛大亨透视辅助软件激活码多个强...