ChatGPT OpenAI API请求限制 尝试解决

1. OpenAI API请求限制

在这里插入图片描述

Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.._completion_with_retry in 4.0 seconds as it raised RateLimitError: Rate limit reached for gpt-3.5-turbo-16k in organization org-U7I2eKpAo6xA7RUa2Nq307ae on requests per min (RPM): Limit 3, Used 3, Requested 1. Please try again in 20s. Visit https://platform.openai.com/account/rate-limits to learn more. You can increase your rate limit by adding a payment method to your account at https://platform.openai.com/account/billing…

原因是free account的限制, 3TPM Time Per Minute每分钟只能请求3次。 https://platform.openai.com/account/limits
在这里插入图片描述
付费5美金以后就放大了, 比如 gpt-3.5-turbo, 60,000 TPM。 https://platform.openai.com/docs/guides/rate-limits/usage-tiers?context=tier-one
在这里插入图片描述

2. Account登录不了

这里有个风险,笔者就遇到了。付费过后4小时就登陆不了了。
在这里插入图片描述

You do not have an account because it has been deleted or deactivated. If you believe this was an error, please contact us through our help center at help.openai.com

2.1 清除chrome缓存,或者其它浏览器

Mac OS 快捷键 command + shift + delete
Clear browsing data > Advance
在这里插入图片描述

2.2 清除OpenAI的缓存

Privacy and security > View permissions and data stored across sites
在这里插入图片描述
All sites > openai
在这里插入图片描述

2.3 发邮件

Dear OpenAI Help Team,

I am experiencing an issue with my OpenAl account. It appears that my account has been
either deleted or deactivated, as I am unable to access it. The error message instructs me to
contact the Help Center for assistance.

As a dedicated user of OpenAl's services, this sudden problem has disrupted my workflow
and caused significant inconvenience. I have attempted basic troubleshooting steps but have
not been able to resolve the issue.

Please investigate this matter urgently and restore access to my account. Here are my account details:

Username: Hero

Email associated with the account: xxx@outlook.com


Additional details:
I charged $5.00 today. 



I apologize for any inconvenience caused and appreciate your swift attention to this matter. If
you require further information, please contact me at xxx@outlook.com


Thank you for your prompt assistance.

Best Regards,
Hero

在这里插入图片描述

在这里插入图片描述

OpenAI的回复
在这里插入图片描述
还在等待OpenAI的回复。。。 大航海时代的限制。。

参考

https://youtu.be/JRnTJjJ3HoA?si=c6C9MsPEpVIoxNYk

要调用OPENAI API实现chatgpt对话,需要按照以下步骤进行操作: 1. 首先,注册OPENAI API账户并获取API密钥。 2. 创建一个Android项目,并添加相应的依赖项,以便可以使用HTTP请求库。 3. 使用HTTP请求库发送POST请求OPENAI API,以获取chatgpt对话结果。可以使用以下代码片段: ``` String url = "https://api.openai.com/v1/engines/davinci-codex/completions"; String apiKey = "YOUR_API_KEY"; JSONObject postData = new JSONObject(); postData.put("prompt", "Hello, how are you?"); postData.put("max_tokens", 50); postData.put("temperature", 0.7); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Content-Type", "application/json") .header("Authorization", "Bearer " + apiKey) .POST(HttpRequest.BodyPublishers.ofString(postData.toString())) .build(); HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); String responseBody = response.body(); ``` 在上面的代码中,我们首先指定了OPENAI API的URL和API密钥。然后,我们创建了一个JSON对象,其中包含要发送给API的参数,例如“prompt”(对话的开头),“max_tokens”(要生成的最大令牌数)和“temperature”(输出的随机性)。最后,我们使用HTTP请求库发送POST请求,并从响应中获取对话结果。 4. 解析OPENAI API的响应,并将结果显示在Android应用程序中。可以使用以下代码片段: ``` JSONObject responseJson = new JSONObject(responseBody); JSONArray choices = responseJson.getJSONArray("choices"); if (choices.length() > 0) { JSONObject choice = choices.getJSONObject(0); String text = choice.getString("text"); // display text in app UI } else { // handle error } ``` 在上面的代码中,我们首先将响应体解析为JSON对象。然后,我们从响应中提取对话结果,将其显示在应用程序的用户界面中。 总之,要调用OPENAI API实现chatgpt对话,需要使用HTTP请求库发送POST请求,并解析响应以获取对话结果。然后,将结果显示在Android应用程序中。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值