Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API KEY Error #274

Open
Andy1996247 opened this issue Jan 7, 2025 · 2 comments
Open

API KEY Error #274

Andy1996247 opened this issue Jan 7, 2025 · 2 comments

Comments

@Andy1996247
Copy link

openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyCh***************************s3hY. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}

Im trying to use Gemini Api Keys and i followed documentation but getting this error . same is happening with Grok

@Andy1996247
Copy link
Author

anyone having similar issues

@DDXBIZ
Copy link

DDXBIZ commented Jan 9, 2025

Not sure if the below helps, but I had problem with ollama / llama3.1 and after looking at the code, I did the following to get it to run...

import os
os.environ["OPENAI_API_KEY"] = "xxxxxxxxxxxxxxxxxxxxxx"
os.environ["OPENAI_BASE_URL"] = "http://localhost:5089/v1"

api_key = os.environ.get("OPENAI_API_KEY")
print(f"API Key: {api_key}")

from praisonaiagents import Agent, Task, PraisonAIAgents

researcher = Agent(
name="Researcher",
role="Senior Research Analyst",
goal="Uncover cutting-edge developments in AI",
backstory="You are an expert at a technology research group",
verbose=True,
llm="llama3.1"
)

task = Task(
name="research_task",
description="Analyze 2024's AI advancements",
expected_output="A detailed report",
agent=researcher
)

agents = PraisonAIAgents(
agents=[researcher],
tasks=[task],
verbose=False
)

result = agents.start()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants