{"text": "Every organization is bound by rate limits which determine how many requests can be sent per second. This rate limit has been hit by the request.\n\n\n\nRate limits can be quantized, meaning they are enforced over shorter periods of time (e.g. 60,000 requests/minute may be enforced as 1,000 requests/second). Sending short bursts of requests or contexts (prompts+max\\_tokens) that are too long can lead to rate limit errors, even when you are technically below the rate limit per minute.\n\n\n\n**How can I fix it?**\n\n\n* Include [exponential back-off](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_handle_rate_limits.ipynb) logic in your code. This will catch and retry failed requests.\n* For token limits\n\n\n\t+ Reduce the [max\\_tokens](https://beta.openai.com/docs/api-reference/completions/create#completions/create-max_tokens) to match the size of your completions. Usage needs are estimated from this value, so reducing it will decrease the chance that you unexpectedly receive a rate limit error. For example, if your prompt creates completions around 400 tokens, the max\\_tokens value should be around the same size.\n\t+ [Optimize your prompts](https://github.com/openai/openai-cookbook/tree/main#more-prompt-advice). You can do this by making your instructions shorter, removing extra words, and getting rid of extra examples. You might need to work on your prompt and test it after these changes to make sure it still works well. The added benefit of a shorter prompt is reduced cost to you. If you need help, let us know.\n* If none of the previous steps work and you are consistently hitting a Rate Limit Error, you can increase your rate limits by [increasing your usage tier](https://platform.openai.com/docs/guides/rate-limits/usage-tiers). You can view your current rate limits, your current usage tier, and how to raise your usage tier/limits in the [Limits section](https://platform.openai.com/account/limits) of your account settings.\n\nIf you'd like to know more, please check out our updated guidance [here](https://beta.openai.com/docs/guides/rate-limits).\n\n", "title": "Rate Limit Advice", "article_id": "6891753", "url": "https://help.openai.com/en/articles/6891753-rate-limit-advice"}