Request rejected (429) · You have exceeded the 5-hour usage quota. It will reset...
错误信息
API Error: Request rejected (429) · You have exceeded the 5-hour usage quota. It will reset at 2026-10-28 14:08:39 +0800 CST. We recommend upgrading your plan for more quota, or waiting for the reset. Request id: 02179315924619341f89ff67558dec75454d97963e9341b35bbbf
AI 解决方案
1. 🌐 错误翻译
原文:API Error: Request rejected (429) · You have exceeded the 5-hour usage quota. It will reset at 2026-10-28 14:08:39 +0800 CST. We recommend upgrading your plan for more quota, or waiting for the reset. Request id: 02179315924619341f89ff67558dec75454d97963e9341b35bbbf
译文:API错误:请求被拒绝(429)· 您已超过5小时使用配额。配额将在2026-10-28 14:08:39 +0800 CST重置。建议升级套餐获取更多配额,或等待重置。请求ID:02179315924619341f89ff67558dec75454d97963e9341b35bbbf
2. 🎯 原因分析
3. 💡 解决方案
async function requestWithRetry() {
try {
const res = await fetch("你的API地址", {
method: "POST",
headers: {"Authorization": "你的密钥"},
body: JSON.stringify({})
});
if (res.status === 429) {
const resetTime = 1761901319000; // 配额重置的毫秒时间戳
const waitSeconds = Math.ceil((resetTime - Date.now()) / 1000);
console.log(`触发限流,等待${waitSeconds}秒后重试`);
await new Promise(resolve => setTimeout(resolve, waitSeconds * 1000));
return await requestWithRetry();
}
return await res.json();
} catch (e) {
console.error("请求异常:", e);
throw e;
}
}