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、山西扣点子技巧ai辅助优化,山西扣点子技巧发...
透视规律"we po... 透视规律"we poker游戏下"详细辅助解密教程(好像是真的有挂)we poker游戏下辅助器中分...
透视ai代打!德扑之心免费透视... 透视ai代打!德扑之心免费透视(透视)永久脚本辅助挂(详细辅助系统教程);1、进入到德扑之心免费透视...
第六分钟了解!福建天天开心辅助... 第六分钟了解!福建天天开心辅助器是真的吗,传送屋app辅助脚本视频(确实是有挂)亲,关键说明,福建天...
透视代打"哈糖大菠萝... 透视代打"哈糖大菠萝有挂吗"详细辅助攻略教程(真是是真的有挂)哈糖大菠萝有挂吗辅助器中分为三种模型:...
透视好牌!约局吧德州可以透视吗... 透视好牌!约局吧德州可以透视吗(透视)永久脚本辅助神器(详细辅助线上教程);1、游戏颠覆性的策略玩法...
3分钟了解!天天微友开控制多少... 3分钟了解!天天微友开控制多少钱,山西扣点工具(真是有挂)1、许多玩家不知道天天微友开控制多少钱辅助...
透视教程"购买wep... 透视教程"购买wepoker模拟器"详细辅助wpk教程(好像真的是有挂)1、购买wepoker模拟器...
透视苹果版!淘宝买wepoke... 透视苹果版!淘宝买wepoker透视有用吗(透视)永久脚本辅助助手(详细辅助我来教教你);1、首先打...
6分钟了解!中至赣牌圈黑科技挂... 6分钟了解!中至赣牌圈黑科技挂件有真的吗,潮汕掌上娱辅助器(原来是有挂);1、下载好中至赣牌圈黑科技...