Why can‘t I access GPT-4 models via API, although GPT-3.5 models work?

**题意:**为什么我无法通过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

python 复制代码
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?

python 复制代码
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.

相关推荐
xier_ran7 分钟前
关键词解释:DAG 系统(Directed Acyclic Graph,有向无环图)
python·算法
顾安r40 分钟前
11.7 脚本网站 中国象棋
python·bash
WenGyyyL1 小时前
微信小程序开发——第二章:微信小程序开发环境搭建
开发语言·python·微信小程序
循环过三天1 小时前
3.2、Python-元组
开发语言·python
Q_Q5110082851 小时前
python+django/flask的篮球馆/足球场地/运动场地预约系统
spring boot·python·django·flask·node.js·php
云雾J视界1 小时前
AI驱动半导体良率提升:基于机器学习的晶圆缺陷分类系统搭建
人工智能·python·机器学习·智能制造·数据驱动·晶圆缺陷分类
朝凡FR1 小时前
AIShareTxt入门:快速准确高效的为金融决策智能体提供股票技术指标上下文
python·ai编程
逻极2 小时前
Spec-Kit 实战指南:从零到一构建“照片拖拽相册”Web App
人工智能·ai·agent·ai编程·web app
Q_Q5110082852 小时前
python+django/flask的城市供水管网爆管预警系统-数据可视化
spring boot·python·django·flask·node.js·php
小白学大数据4 小时前
增量爬取策略:如何持续监控贝壳网最新成交数据
爬虫·python·性能优化