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.

相关内容

热门资讯

这一问题亟待解决!创思维激k辅... 这一问题亟待解决!创思维激k辅助控制器(辅助挂)总是真的是有辅助攻略(有挂教程)1、创思维激k辅助控...
一分钟了解!大唐辅助神器(辅助... 一分钟了解!大唐辅助神器(辅助挂)本来是真的有辅助app(有挂透视)1、大唐辅助神器破解器简单,大唐...
推荐一款!新超凡辅助(辅助挂)... 推荐一款!新超凡辅助(辅助挂)一直是真的有辅助器(有挂神器)该软件可以轻松地帮助玩家将新超凡辅助外卦...
盘点十款!卡五星辅助神器(辅助... 盘点十款!卡五星辅助神器(辅助挂)确实是有辅助技巧(了解有挂)1、卡五星辅助神器辅助器安装包、卡五星...
一分钟了解!雀姬辅助(辅助挂)... 一分钟了解!雀姬辅助(辅助挂)都是真的有辅助技巧(真的有挂)1、完成雀姬辅助有辅助插件,帮助玩家取得...
热门推荐!潮汕鱼虾蟹app源码... 热门推荐!潮汕鱼虾蟹app源码(辅助挂)一贯真的是有辅助器(有挂分享)一、潮汕鱼虾蟹app源码可以开...
玩家必看教程!来趣广西友玩脚本... 玩家必看教程!来趣广西友玩脚本辅助(辅助挂)其实是有辅助神器(果真有挂)1、玩家可以在来趣广西友玩脚...
据文件显示!微信小程序中至赣牌... 据文件显示!微信小程序中至赣牌圈辅助(辅助挂)本来真的是有辅助教程(有挂方法)1、实时微信小程序中至...
揭秘一下!极速猜一猜辅助(辅助... 揭秘一下!极速猜一猜辅助(辅助挂)本来真的是有辅助工具(竟然有挂)1)极速猜一猜辅助免费钻石:进一步...
玩家必备科技!先锋大厅辅助(辅... 您好,先锋大厅辅助这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302】很多玩家在...