# Error while executing code

**URL:** <https://community.deeplearning.ai/t/error-while-executing-code/632537>\
**Category:** Multi AI Agent Systems with crewAI\
**Created:** [May 22, 2024, 10:31am UTC](https://community.deeplearning.ai/t/error-while-executing-code/632537 "2024-05-22T10:31:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ratheesh](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@Ratheesh](https://community.deeplearning.ai/u/Ratheesh)\
**Post date:** [May 22, 2024, 10:31am UTC](https://community.deeplearning.ai/t/error-while-executing-code/632537/1 "2024-05-22T10:31:11Z")

</div>

Hello,  
I am using google collab, when I use open ai key

import os

from google.colab import userdata

# Get the API keys using the userdata module

openai\_api\_key = userdata.get(‘openai’)

# Set the environment variable

os.environ[“OPENAI\_API\_KEY”] = openai\_api\_key

os.environ[“OPENAI\_MODEL\_NAME”] = ‘gpt-3.5-turbo’

I am getting the following error

RateLimitError Traceback (most recent call last)  
 in \<cell line: 1\>()  
----\> 1 result = crew.kickoff(inputs=inputs)

22 frames  
/usr/local/lib/python3.10/dist-packages/openai/\_base\_client.py in \_request(self, cast\_to, options, remaining\_retries, stream, stream\_cls)  
1018  
1019 log.debug(“Re-raising status error”)  
 → 1020 raise self.\_make\_status\_error\_from\_response(err.response) from None  
1021  
1022 return self.\_process\_response(

RateLimitError: Error code: 429 - {‘error’: {‘message’: ‘You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: [https://platform.openai.com/docs/guides/error-codes/api-errors.](https://platform.openai.com/docs/guides/error-codes/api-errors.)’, ‘type’: ‘insufficient\_quota’, ‘param’: None, ‘code’: ‘insufficient\_quota’}}

However, when I use HF

from google.colab import userdata  
from langchain\_community.llms import HuggingFaceEndpoint

# Get the API key using the userdata module

HF\_token = userdata.get(‘HF’)

# Use the new class here

llm = HuggingFaceEndpoint(  
repo\_id=“HuggingFaceH4/zephyr-7b-beta”,  
huggingfacehub\_api\_token=HF\_token,  
task=“text-generation”,  
)

I am getting following error,

AuthenticationError Traceback (most recent call last)  
 in \<cell line: 1\>()  
----\> 1 result = crew.kickoff(inputs={  
2 “customer”: “DeepLearningAI”,  
3 “person”: “Andrew Ng”,  
4 “inquiry”: "I need help with setting up a Crew "  
5 "and kicking it off, specifically "

18 frames  
/usr/local/lib/python3.10/dist-packages/openai/\_base\_client.py in \_request(self, cast\_to, options, remaining\_retries, stream, stream\_cls)  
1018  
1019 log.debug(“Re-raising status error”)  
 → 1020 raise self.\_make\_status\_error\_from\_response(err.response) from None  
1021  
1022 return self.\_process\_response(

AuthenticationError: Error code: 401 - {‘error’: {‘message’: ‘Incorrect API key provided: fake. You can find your API key at [https://platform.openai.com/account/api-keys.](https://platform.openai.com/account/api-keys.)’, ‘type’: ‘invalid\_request\_error’, ‘param’: None, ‘code’: ‘invalid\_api\_key’}}

Can Someone help me with this?

Thanks,  
Ratheesh

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [May 22, 2024, 2:50pm UTC](https://community.deeplearning.ai/t/error-while-executing-code/632537/2 "2024-05-22T14:50:29Z")

</div>

> [@Ratheesh](#):
>
> RateLimitError: Error code: 429 - {‘error’: {‘message’: ‘You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: [https://platform.openai.com/docs/guides/error-codes/api-errors.’](https://platform.openai.com/docs/guides/error-codes/api-errors.%E2%80%99), ‘type’: ‘insufficient\_quota’, ‘param’: None, ‘code’: ‘insufficient\_quota’}}

To resolve the above error, kindly refer the below link which explains the step for you to follow

> [@Multi AI Agent Systems with crewAI: local run problems](https://community.deeplearning.ai/t/multi-ai-agent-systems-with-crewai-local-run-problems/630528/2):
>
> You can refer the below link, to find solution.
