The openai api key error while running the kickoff

i am using the ChatGoogleGenerativeAI as an LLM. but every time i want to execute my code. i will get the following error:

Value error, Please provide an OpenAI API key. You can get one at https://platform.openai.com/account/api-keys [type=value_error, input_value={'agents': [Agent(role=Us...': True, 'memory': True}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.10/v/value_error

i do not why but i am using my cutom LLM and still getting this error. I have pass the LLm to the agents.

I found that i have to pass my custom llm not only to the agents but also to the crew. You may also need to provide an “api_key” even if not required by your LLM Backend but just to not get the OpenAI API KEy error.

crew = Crew(
  llm=LLM(
    model="ollama/qwen2.5-coder:32b",
    api_key="ollama",
    base_url="http://localhost:11434"
  ),
  agents=[developer, debugger, save_agent],
  tasks=[generate_code_task, debug_code, save_code],
  process=Process.sequential,  # Execute tasks in sequence.
  verbose=True
)

no its not working. i used your method but still getting this error

I would recommend you to use this way
Agent(…,…,
llm=LLM(model=“ollama/mistral”, base_url=“http://127.0.0.1:11434”)
)

I used mistral you can give your model name according to your need.
If no API key is required then dont add anything just skip giving random things in API Itself.

@Tayyab_Tanveer – Can you share your code?