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

相关内容

热门资讯

黑科技辅助(德扑之星房间设置)... 黑科技辅助(德扑之星房间设置)外挂软件透明挂智能ai代打辅助脚本(透视)线上教程(2020已更新)(...
9分钟了解!新上游辅助器插件开... 9分钟了解!新上游辅助器插件开挂,潘潘讲故事辅助器软件透视挂(最新版本2026)潘潘讲故事辅助器软件...
总算清楚!微扑克规律,太坑了好... 总算清楚!微扑克规律,太坑了好像存在有挂(2021已更新)(哔哩哔哩);1、让任何用户在无需AI插件...
两分钟透视挂!新二号辅助下载,... 两分钟透视挂!新二号辅助下载,新天道作弊(微信链接牛牛辅助开挂教程)1、新二号辅助下载系统规律教程、...
总算了解“aapoker辅助器... 总算了解“aapoker辅助器免费版最新版更新内容”(透视)详细开挂辅助技巧我们需要明确“透视”的定...
黑科技辅助(wEpoke)外挂... 黑科技辅助(wEpoke)外挂软件透明挂智能ai辅助器安装(透视)可靠技巧(2023已更新)(哔哩哔...
第6分钟了解!边锋老友圈怎么开... 第6分钟了解!边锋老友圈怎么开辅助插件开挂,边锋老友修改器软件透视挂(最新版本2026)1、玩家可以...
必备科技!微扑克辅助软件,太坑... 必备科技!微扑克辅助软件,太坑了一直真的有挂(2025已更新)(哔哩哔哩);是一款可以让一直输的玩家...
5分钟透视挂!道游互娱辅助,人... 5分钟透视挂!道游互娱辅助,人海大厅挂件怎么买(微信链接炸金花辅助开挂app)1、5分钟透视挂!道游...
分享一款“wepoker作z弊... 分享一款“wepoker作z弊辅助软件”(透视)详细开挂辅助教程wepoker透视模式是一种用于we...