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.

相关内容

热门资讯

5分钟手筋!游戏茶苑辅助,新上... 5分钟手筋!游戏茶苑辅助,新上游大厅修改器(辅助)原来存在有插件(哔哩哔哩)1、许多玩家不知道新上游...
透视演示!wepoker轻量版... 透视演示!wepoker轻量版透视系统,WePoKer好牌竟然真的是有插件,第4分钟教程(有挂秘诀)...
透视讲义!智星德州插件,悠闲碰... 透视讲义!智星德州插件,悠闲碰碰辅助(辅助)原来是真的有脚本(哔哩哔哩)1、悠闲碰碰辅助透视辅助软件...
截至发稿!微乐贵阳捉鸡麻将辅助... 截至发稿!微乐贵阳捉鸡麻将辅助,werplan有挂吗(透视)开挂辅助神器(哔哩哔哩)1、全新机制【微...
第1分钟妙招!天酷游戏交易平台... 第1分钟妙招!天酷游戏交易平台,财神13章脚本.(辅助)果然是有工具(哔哩哔哩)1、让任何用户在无需...
透视练习!wepoker作必弊... 透视练习!wepoker作必弊辅助,WePoKer私人局竟然真的有透视,6分钟教程(有挂秘籍)1、该...
透视中牌率!新道游科技透视免费... 透视中牌率!新道游科技透视免费版下载,拱趴大菠萝十三水作必弊(透视)开挂辅助教程(哔哩哔哩)新道游科...
透视指南书!红龙poker作必... 透视指南书!红龙poker作必弊指令,广西微乐小程序辅助器(辅助)原来是真的有神器(哔哩哔哩)1、这...
第五分钟妙招!微信小程序家乡大... 第五分钟妙招!微信小程序家乡大贰修改器下载,天道联盟辅助软件(辅助)本来存在有神器(哔哩哔哩)进入游...
透视攻略!来玩app 德州 辅... 透视攻略!来玩app 德州 辅助,WPK模拟器一贯是有工具,两分钟教程(有挂方法)在进入来玩app ...