I’m trying to access the Google Gemini API via the http_request node. Here are my settings.
I’m getting a 400 error (I’m providing the error text).
I’ve tried different authorization methods—both through parameters and by directly specifying it in the URL. However, curl works perfectly fine. So, the API Key is correct. Also, the AI Agent with the connected Gemini LLM works well with this API Key—the issue is solely with the http_request node.*
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-embedding-exp-03-07:embedContent?key=$GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"model": "models/gemini-embedding-exp-03-07",
"content": {
"parts":[{
"text": "What is the meaning of life?"}]}
}'
- n8n version: 1.90.2 (self-hosted)
- Database (default: SQLite): SQLite
- n8n EXECUTIONS_PROCESS setting (default: own, main): main
- Running n8n via (Docker, npm, n8n cloud, desktop app): npm
- Operating system: Debian 12