首页 > 其他分享 >Why can‘t I access GPT-4 models via API, although GPT-3.5 models work?

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

时间:2024-07-15 23:28:32浏览次数:12  
标签:3.5 via models gpt API openai key GPT

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

标签:3.5,via,models,gpt,API,openai,key,GPT
From: https://blog.csdn.net/suiusoar/article/details/140451718

相关文章

  • Auto-GPT Command evaluate_code returned: Error: The model: `gpt-4` does not exis
    题意:Auto-GPT命令evaluate_code返回:错误:模型 gpt-4 不存在。问题背景:I'mworkingwith auto-gpt andIgotthiserror:Commandevaluate_codereturned:Error:Themodel:`gpt-4`doesnotexistandit'slikeitcan'tgofurthermore.whatshouldIdo?......
  • 算法金 | 秒懂 AI - 深度学习五大模型:RNN、CNN、Transformer、BERT、GPT 简介
    1.RNN(RecurrentNeuralNetwork)时间轴1986年,RNN模型首次由DavidRumelhart等人提出,旨在处理序列数据。关键技术循环结构序列处理长短时记忆网络(LSTM)和门控循环单元(GRU)核心原理RNN通过循环结构让网络记住以前的输入信息,使其能够处理序列数据。每个节点不仅接收当......
  • ATTACKS ON THIRD-PARTY APIS OF LARGE LANGUAGE MODELS
    本文是LLM系列文章,针对《ATTACKSONTHIRD-PARTYAPISOFLARGELANGUAGEMODELS》的翻译。对大型语言模型第三方api的攻击摘要1引言2提出的流水线3实验4结论摘要大型语言模型(LLM)服务最近开始提供一个插件生态系统来与第三方API服务交互。这项创新增强了LLM的能......
  • GPT-4从0到1搭建一个Agent简介
    GPT-4从0到1搭建一个Agent简介1.引言在人工智能领域,Agent是一种能够感知环境并采取行动以实现特定目标的系统。本文将简单介绍如何基于GPT-4搭建一个Agent。2.Agent的基本原理Agent的核心是感知-行动循环(Perception-ActionLoop),该循环可以描述如下:感知:Agent通过传感......
  • AI学习 | chatgpt_api 和 tiktoken使用
    fromopenaiimportOpenAIimporttiktoken 如何使用chatgpttoken#创建实例,因为密钥已经传入环境变量,所以这里不用输入了client=OpenAI()#开始对话 response=client.chat.completions.create(model="gpt-3.5-turbo",messages=[{"role":"sys......
  • Improving News Recommendation via Bottlenecked Multi-task Pre-training论文阅读笔
    ImprovingNewsRecommendationviaBottleneckedMulti-taskPre-training论文阅读笔记Abstract现存的问题:​ 现有的PLM大多是在大规模通用语料库上预先训练的,并没有专门用于捕捉新闻文章中的丰富信息。因此,它们生成的新闻嵌入信息可能不足以表示新闻内容或描述新闻之间的关......
  • WPF generate rows and columns via C# dynamically
    //xaml<Windowx:Class="WpfApp214.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.mi......
  • 新一代大语言模型 GPT-5 对工作与生活的影响及应对策略
    文章目录......
  • GPT4.0开通方法
    很多人还在用虚拟卡开通官网的gpt却不知道国内已经出现很多反代官网的镜像站了今天我就给大家推荐一个我经常用的而且他一个月只需要24.9https://gpt.bpjgpt.top/开通步骤......
  • 2024年7月11日实测,可用ChatGPT的方法!!!!!!!!!
    直接上干货已经成为了我得习惯☆直达地址推荐用火狐浏览器这样实测进去的速度比较快并且无需魔法哦(而且这里面的gptplus会员才24.9实测真的很完美啊!!!!!!!!!)......