Google Generative AI Conversation - 400 Error

I’ve read the details very carefully - even allowsed the API key fully unrestricted access - but I have configured “Google Generative AI Conversation” with it’s API key and then included it as the conversation agent in an assistant pipeline.

Whenever I ask it any question at all - like ‘whats the current time?’ - I simply get 'Sorry, I had a problem talking to Google Generative AI: 400 Precondition check failed.".

I tried pulling a debug log, but it seems it only logs one line:

2024-01-01 13:03:40.682 DEBUG (MainThread) [homeassistant.components.google_generative_ai_conversation] Prompt for models/chat-bison-001: [{'author': '0', 'content': "what's the current time?"}]

I’m really lost on what to check next? Any ideas?

Have you solved the issue? I am getting the same problem

Same issue. It says.I have to have a billing account linked… whatever that means. I chose the “free” tier when creating the API key…

Hi, In some areas the free tier does not give the you the right to use the API in other applications. You can check the list here: https://ai.google.dev/gemini-api/docs/available-regions

1 Like

Thanks. I figured it out. Had to ho for the “paid” tier and register and now it works. I haven’t actually used it yet, but I could…:grin:

same issue here