Google Search Plugin (Potentially Bug or Misconfiguration ?) #7923
Replies: 2 comments 1 reply
-
Your errors point to two separate but related issues involving Google Gemini API integration in LibreChat. Let's break it down and solve them step by step. ✅ 1. 400: API key not valid
🔍 Cause: This error means the Google Search tool (probably SerpAPI, Google Custom Search, or Gemini Tools using Google APIs) is missing or using an invalid API key. ✅ Fix: Make sure you properly set the required API key in your .env or Docker Compose. If you're using Google Custom Search or Google API, check for these variables:
Or for SerpAPI (used in some setups):
Also ensure your agent config in agents.json or Admin panel explicitly enables the "search" tool and points to the right tool setup. ✅ 2. 404: Publisher Model not found
🔍 Cause: This error means you're trying to access a Gemini model version that either: Doesn't exist in your current project/region. Is not publicly accessible. You are using the wrong model ID or don't have permission. ✅ Fix: Check these: a) 🔧 Correct Model Names The Gemini API expects official model names, not aliases. Example valid names: models/gemini-1.5-pro-latest models/gemini-1.5-flash-latest Try replacing your config with one of these known working names. b) 📍 Ensure You're Using the Right Project ID If you’re hardcoding projects/librechat-1749684596838, that must match your actual GCP project. You might not have access to that publisher model if: It’s a custom or test project. You're using a different region or have incorrect permissions.
Using public model names with publishers/google/models/… Or setting up the correct project via your Gemini API dashboard ✅ 3. Bonus: tts is undefined
This likely means: TTS config is missing in your agent setup (e.g., no provider or key set). The model/agent you're using doesn't support audio streaming. ✅ Fix: In your .env or Agent config:
Or disable audio output in the UI or agent configuration if not needed. ✅ Final Checklist to Fix Everything ✅ Item Description ✅ GOOGLE_API_KEY set Required for Gemini + search |
Beta Was this translation helpful? Give feedback.
-
FIndings so far, The Google Search remains the same
Although I'm disable all restrictions it is still not working. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Current Condition:
I try to follow this documentation to enable Google Search on Agent endpoint and I’ve set up the
GOOGLE_SEARCH_API_KEY
andGOOGLE_CSE_ID
properly., but this error log keeps appearing.Agent Model:
gemini-2.5-flash-preview-05-20
Error shown in LOGIf I switch to gemini pro model
Agent Model:
gemini-2.5-pro-preview-06-05
Error shown directly on chatBeta Was this translation helpful? Give feedback.
All reactions