OpenAI API giving error: 429 Too Many Requests
创始人
2024-11-12 00:35:14
0

题意:OpenAI API 返回错误:429 请求过多

问题背景:

I am trying to make a request to the openai API with the following code in express nodeJS:

我正在尝试使用以下 Express Node.js 代码向 OpenAI API 发送请求:

import { Configuration, OpenAIApi } from "openai";  const configuration = new Configuration({     organization: "org-Fn2EqsTpiUCTKb8m61wr6H8m",     apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", }); const openai = new OpenAIApi(configuration);  async function callApi() {     const response = await openai.createCompletion({         model: "text-davinci-003",         prompt: "Say this is a test",         max_tokens: 3000,         temperature: 0,       });      console.log(response.data.choices[0].text); }  callApi();

The problem is that I keep getting error 429 Too many requests.

问题是,我一直收到错误 429 请求过多。

Here some more information:        这里有更多的信息:

  • The API key is correct.        API key是正确的
  • When I go to my openai account > view API KEY: it shows that the key was never used so I have never been able to make a call. So how is it possibile that I'm getting error Too many requests?

当我进入我的 OpenAI 账户 > 查看 API 密钥时:它显示该密钥从未被使用过,所以我从未能够发起任何调用。那么,我怎么可能收到‘请求过多’的错误呢?

  • I have already tried to implement exponential backoff in the function, but it didn't work.

我已经尝试在该函数中实现指数退避(exponential backoff),但它没有起作用。

问题解决:

I had the same issue. The reason was that I created my API key BEFORE converting my OpenAI account to paid (adding credit card). Doesn't matter if you only upgrade, you also need to create a new api key entirely.

我也遇到了同样的问题。原因是在我将 OpenAI 账户转换为付费账户(添加信用卡)之前创建了我的 API 密钥。无论你是否只是升级了账户,你都需要完全创建一个新的 API 密钥。

I created another API key AFTER I added my credit card and it worked fine!

在我添加信用卡之后,我创建了另一个 API 密钥,并且它工作正常!

相关内容

热门资讯

透视脚本!微信小程序财神破解版... 透视脚本!微信小程序财神破解版,微乐小程序游戏破解器(开挂)原来存在有挂(有挂助手)-哔哩哔哩1、进...
出乎意料的是!wpk辅助软件,... 出乎意料的是!wpk辅助软件,wpk官网下载链接(透视)操作脚本(真是有挂)-哔哩哔哩1、完成wpk...
透视详细!德州局脚本(透视)w... 透视详细!德州局脚本(透视)wejoker开挂,教程攻略(有挂解惑)-哔哩哔哩1、进入游戏-大厅左侧...
备受关注的!德普辅助软件,hh... 备受关注的!德普辅助软件,hhpoker有没有开挂(透视)指南教程(确实真的有挂)1、玩家可以在hh...
透视安卓版!心悦提坑神器软件下... 透视安卓版!心悦提坑神器软件下载,财神十三章辅助软件(开挂)一贯是真的挂(有挂解密)-哔哩哔哩1、操...
不少玩家反映!wepoker私... 不少玩家反映!wepoker私人局辅助器怎么用,wepoker透视方法(透视)步骤脚本(果然真的是有...
透视真的!八闽十三水破解版辅助... 透视真的!八闽十三水破解版辅助,新道游开挂辅助透视(开挂)其实有挂(有挂解密)-哔哩哔哩1、在八闽十...
这一问题亟待解决!aapoke... 这一问题亟待解决!aapoker怎么开辅助器,aa poker透视软件(透视)指南脚本(竟然存在有挂...
透视黑科技!心悦踢坑神器软件下... 透视黑科技!心悦踢坑神器软件下载,卡农大厅辅助(开挂)果然有挂(有挂秘笈)-哔哩哔哩1)心悦踢坑神器...
据目击者称!aapoker怎么... 据目击者称!aapoker怎么选牌,aapoker透视怎么用(透视)窍门脚本(竟然是有挂)-哔哩哔哩...