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

相关内容

热门资讯

透视线上!hhpoker透视脚... 透视线上!hhpoker透视脚本视频,hhpoker辅助软件,2025新版教程(有挂脚本)一、hhp...
hhpoker辅助器!wepo... hhpoker辅助器!wepoker怎么提高运气(透视)总是是有挂(解密教程)wepoker怎么提高...
透视好牌!德州作弊设备,扑克世... 透视好牌!德州作弊设备,扑克世界辅助软件(详细辅助揭秘教程),支持语音通讯、好友开房及战队组建,强化...
透视有挂!wpk透视工作室,w... 透视有挂!wpk透视工作室,wpk辅助器安装,细节方法(有挂黑科技);1)wpk透视工作室辅助挂:进...
透视有挂!pokerworld... 透视有挂!pokerworld透视作弊,菠萝神辅助器功能(详细辅助第三方教程)需要回顾用户提供的搜索...
wepoker作弊辅助!wpk... wepoker作弊辅助!wpk模拟器(透视)都是有挂(软件教程);运wepoker作弊辅助辅助工具,...
透视透视!wepoker辅助透... 透视透视!wepoker辅助透视软件,aapoker脚本怎么用,微扑克教程(有挂技巧)1)wepok...
透视透视挂!governor ... 透视透视挂!governor of poker3破解版,wepoker私人局透视挂真的吗(详细辅助详...
wepoker作弊辅助!wep... wepoker作弊辅助!wepoker破解是真的还是假的(透视)原来真的有挂(普及教程)1、实时we...
透视计算!wpk有脚本吗,hh... 透视计算!wpk有脚本吗,hhpoker辅助软件下载,第三方教程(有挂细节)1、下载好hhpoker...