# RateLimitError using Openai

**URL:** <https://community.crewai.com/t/ratelimiterror-using-openai/2955>\
**Category:** CrewAI Community Support\
**Created:** [January 18, 2025, 5:11am UTC](https://community.crewai.com/t/ratelimiterror-using-openai/2955 "2025-01-18T05:11:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karthik](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@Karthik](https://community.crewai.com/u/Karthik)\
**Post date:** [January 18, 2025, 5:11am UTC](https://community.crewai.com/t/ratelimiterror-using-openai/2955/1 "2025-01-18T05:11:18Z")

</div>

I am using OpenAI and running the agnet I get the below error periodically:

File “C:\Agent AI\PLAYGROUND\tccreator.venv\Lib\site-packages\litellm\litellm\_core\_utils\exception\_mapping\_utils.py”, line 1231, in exception\_type  
raise RateLimitError(  
litellm.exceptions.RateLimitError: litellm.RateLimitError: litellm.RateLimitError: VertexAIException - {  
“error”: {  
“code”: 429,  
“message”: “Resource has been exhausted (e.g. check quota).”,  
“status”: “RESOURCE\_EXHAUSTED”

Is there a way to address this issue and make the agent run without failing?

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![joab.io](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/joab.io/32/2143_2.png) [@joab.io](https://community.crewai.com/u/joab.io)\
**Post date:** [January 18, 2025, 11:59am UTC](https://community.crewai.com/t/ratelimiterror-using-openai/2955/2 "2025-01-18T11:59:12Z")

</div>

It looks like your Agents are exceeding the limits of your LLM subscription.

You can rate limit the agents by setting the maximum `requests per minute`  
by setting this parameter for your agents in the crew.py file

`max_rpm` = a number less than your quota allows

There are also other parameters such as maximum iterations and maximum retries that can be set. Follow some of the examples here:

[Agents - CrewAI](https://docs.crewai.com/concepts/agents)

Good luck!

---

<div class="post-metadata">

**Author:** ![Karthik](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@Karthik](https://community.crewai.com/u/Karthik)\
**Post date:** [January 19, 2025, 8:30am UTC](https://community.crewai.com/t/ratelimiterror-using-openai/2955/3 "2025-01-19T08:30:56Z")

</div>

Thanks so much for your quick response Joab. Will try your suggestion 👍

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex025/uploads/crewai/original/1X/ecda97e72f77c7100e0a761444b1c991925cc789.png) [@system](https://community.crewai.com/u/system)\
**Post date:** [January 20, 2025, 8:31am UTC](https://community.crewai.com/t/ratelimiterror-using-openai/2955/4 "2025-01-20T08:31:20Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
