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 密钥,并且它工作正常!

相关内容

热门资讯

9分钟内幕!wepoke显示有... 9分钟内幕!wepoke显示有(黑科技辅助挂)外挂透明挂辅助APP(2022已更新)(知乎)wepo...
透视辅助挂!wpk真的有外挂&... 透视辅助挂!wpk真的有外挂"wpk号一直输"其实真的有挂(有挂大厅房)-知乎1、许多玩家不知道wp...
软件辅助挂(pokerrrr2... 软件辅助挂(pokerrrr2)wpk系统发牌规律(透明黑科技)一般真的有挂(有挂开挂)-百度1、玩...
9分钟晓得!wepower辅助... 9分钟晓得!wepower辅助器(黑科技)外挂透明挂辅助神器(2024已更新)(微博客户端)在进入w...
黑科技辅助挂!wpk ai辅助... 黑科技辅助挂!wpk ai辅助"智星德州菠萝app下载"一贯真的有挂(有挂大厅房)-小红书;1、完成...
透明辅助挂(AAPoker)w... 透明辅助挂(AAPoker)wpk德州透视辅助(黑科技)都是真的有挂(有挂玄学)-百度;1、构建自己...
黑科技透视!wpk外挂&quo... 黑科技透视!wpk外挂"wepoke挂真的假的"本来真的有挂(有挂私人局)-哔哩哔哩一、wepoke...
五分钟分享!德扑软件高端(透视... 五分钟分享!德扑软件高端(透视)外挂透明挂辅助插件(2024已更新)(微博客户端)进入游戏-大厅左侧...
智能辅助(wEpoke)德扑之... 智能辅助(wEpoke)德扑之星的机制(软件透明挂)就是真的有挂(有挂苹果版本)-知乎小薇(透视辅助...
透明黑科技!微扑克全自动机器人... 透明黑科技!微扑克全自动机器人"wepork私人局有挂"的确是有挂的(有挂针对)-百度贴吧1、点击下...