For streaming requests, these HTTP error responses apply before the stream starts. An error after streaming begins can arrive as a stream event; don’t automatically replay a request after consuming output.
What are some steps I can take to mitigate this?
The OpenAI Cookbook has a
Python notebook
that explains how to avoid rate limit errors, as well an example
Python script
for staying under rate limits while batch processing API requests.
You should also exercise caution when providing programmatic access, bulk processing features, and automated social media posting - consider only enabling these for trusted customers.
To protect against automated and high-volume misuse, set a usage limit for individual users within a specified time frame (daily, weekly, or monthly).
