L4 - on Inputs getting Incorrect API key provided

Using Google Colab:

I added code "%env OPENAI_API_KEY=“openai_API_Key fromOpenAI”

inputs = {
“lead_name”: “DeepLearningAI”,
“industry”: “Online Learning Platform”,
“key_decision_maker”: “Andrew Ng”,
“position”: “CEO”,
“milestone”: “product launch”
}

result = crew.kickoff(inputs=inputs)

Ran it and got:

AuthenticationError Traceback (most recent call last)
in <cell line: 0>()
7 }
8
----> 9 result = crew.kickoff(inputs=inputs)

18 frames
/usr/local/lib/python3.11/dist-packages/openai/_base_client.py in _request(self, cast_to, options, retries_taken, stream, stream_cls)
1062
1063 log.debug(“Re-raising status error”)
→ 1064 raise self._make_status_error_from_response(err.response) from None
1065
1066 return self._process_response(

AuthenticationError: Error code: 401 - {‘error’: {‘message’: ‘Incorrect API key provided: “097c927******************************************************712”. You can find your API key at https://platform.openai.com/account/api-keys.’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: ‘invalid_api_key’}}

I was able to use same OPEN_AI_KEY for

sales_rep_agent = Agent(
role=“Sales Representative”,
goal="Identify high-value leads that match "
“our ideal customer profile”,
backstory=(
"As a part of the dynamic sales team at CrewAI, "
"your mission is to scour "
"the digital landscape for potential leads. "
"Armed with cutting-edge tools "
"and a strategic mindset, you analyze data, "
"trends, and interactions to "
"unearth opportunities that others might overlook. "
"Your work is crucial in paving the way "
“for meaningful engagements and driving the company’s growth.”
),
allow_delegation=False,
verbose=True
)

without any problem.

Anythong I. did wrong?

Thanks.

Peter

please post a screenshot of the error rather than copy pasting, you haven’t shared the complete error log. if your error log is too lengthy, take two separate screenshots and post

Deepti:

The course is Multi AI Agent System with CrewAI.

included three screen shots.

All from using Google Colab.

The first one is the error caused by invalid openai_api_key on the inputs cell. The last cell for L4 lesson coding.

The second one shows the setup for openai_api_key and serper_api-key.

The third one shows the sales-rep_agent set up is successul usnig openai_api_key.

Thanks for your help.

Peter

this authorisation error is already reported to staff and no update has been yet reported.

@lesly.zerna any update on this issue?? this was already reported by 3-4 learners earlier and you mentioned in another post that staff is working upon

Please can you provide information on any update for this issue

Deepti:

Thank you very much.

Peter

1 Like

I run into the same error but in L3, when i run the notebook locally with a local hosted LLM. L2 works fine but in L3 i get the error: Incorrect API key provided. When providing an valid OpenAI Key in the env_vars its runs and is interacting with the local served LLM

but runs into another error unfortunatly, but seems locally and related to this topic.

Hi, reported with the team, let me follow up! Thank you for the mention!