# openai.RateLimitError: 您已超出当前配额，请检查您的计划和账单详情。

- **ID:** `llm/embeddings-api-quota-exceeded`
- **领域:** llm
- **类别:** resource_error
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

API使用量已超出当前付费层的令牌数或请求配额，或账户余额不足。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| openai>=1.0.0 | active | — | — |
| openai==0.28.0 | active | — | — |

## 解决方案

1. ```
   在https://platform.openai.com/account/billing检查账单仪表板并添加资金或升级套餐。然后通过API监控使用量：
import openai
usage = openai.Usage.retrieve()
print(usage)
   ```
2. ```
   当超出配额时，实现回退到不同的嵌入模型或提供商：
if 'quota' in str(e):
    model = 'text-embedding-ada-002'  # 回退到更便宜的模型
    response = openai.Embedding.create(input=text, model=model)
   ```

## 无效尝试

- **** — The error is a quota exhaustion, not a rate limit. Retrying will keep failing until the billing period resets or more credits are added. (70% 失败率)
- **** — The quota is based on total usage, not request size. Reducing batch size doesn't help if the total quota is exhausted. (50% 失败率)
