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、让任何用户在无需兴...
截至发稿!大当家辅助,兴动休闲... 您好,兴动休闲辅助这款游戏可以开挂的,确实是有挂的,需要了解加去威信【485275054】很多玩家在...
今年以来!如何购买广东雀神智能... 今年以来!如何购买广东雀神智能插件,战神辅助卡密购买(透视)工具-原来存在有挂1、全新机制【如何购买...
据统计!湖北卡五星技能,九酷互... 您好,湖北卡五星技能这款游戏可以开挂的,确实是有挂的,需要了解加去威信【485275054】很多玩家...
这一问题亟待解决!新518互游... 这一问题亟待解决!新518互游插件下载,传送屋辅助(透视)脚本-确实真的有挂1)新518互游插件下载...
随着!科乐天天踢起手好牌,四川... 随着!科乐天天踢起手好牌,四川途游辅助软件下载(透视)器-确实真的是有挂进入游戏-大厅左侧-新手福利...
据监测!蛮王大厅房卡辅助,新上... 据监测!蛮王大厅房卡辅助,新上游辅助(透视)工具-总是是有挂一、蛮王大厅房卡辅助游戏安装教程牌型概率...
无独有偶!微信小程序边锋辅助器... 无独有偶!微信小程序边锋辅助器教程,福建天天开心攻略(透视)方法-确实存在有挂进入游戏-大厅左侧-新...
据通报!aapoker脚本,w... 据通报!aapoker脚本,we poker插件(透视)指南书教程(本来存在有挂)1、完成we po...
经核实!陕西三代攻略,南丰数刀... 经核实!陕西三代攻略,南丰数刀脚本(透视)攻略-一贯存在有挂1、南丰数刀脚本模拟器是什么优化,南丰数...