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、实时牛总管手游辅助开挂更新:用户可以随...
新版黑科技!pokerx机器人... 新版黑科技!pokerx机器人(透视)太坑了存在有挂(玩家教你黑科技黑科技);小薇(透视辅助)致您一...
黑科技智能ai"微扑... 黑科技智能ai"微扑克辅助挂!外挂透明挂辅助科技(黑科技)详细教程"一贯真的有挂1、很好的工具软件,...
黑科技插件!德扑之星里面怎么隐... 黑科技插件!德扑之星里面怎么隐藏入池率(wePOKE)外挂黑科技辅助软件(我来教教大家黑科技技巧);...
实用技巧!越乡游义乌辅助器微信... 实用技巧!越乡游义乌辅助器微信免费,新蜜瓜大厅牛牛外 挂透视辅助器,九九山城辅助免费1、越乡游义乌辅...
黑科技好友"微扑克有... 黑科技好友"微扑克有没有挂!外挂透明挂辅助工具(黑科技)插件教程"一直有挂1、上手简单,内置详细流程...
工具黑科技!红龙扑克辅助工具(... 工具黑科技!红龙扑克辅助工具(透视)太坑了真的是有挂(科技教程黑科技教程);一、红龙扑克辅助工具AI...
黑科技线上!德州之星讲解(WE... 黑科技线上!德州之星讲解(WEPOKE)黑科技辅助机制(实测教程黑科技技巧);亲真的是有正版授权,小...
安装教程!新天道怎么看底牌,火... 安装教程!新天道怎么看底牌,火神炸金花透视挂辅助,黑科技辅助器软件;1、完成新天道怎么看底牌透视辅助...
黑科技最新"wepo... 黑科技最新"wepoke软件透明挂辅助!外挂透明挂辅助挂(黑科技)细节方法"竟然是真的有挂1、让任何...