HTTP Request Node always "json:false"

Describe the problem/error/question

Hi everyone,

I’m currently trying to build an HTTP Request node in n8n to send a prompt to the Gemini image generation model.

The problem is that no matter what I do, the node always returns json:false. Because of this, it seems like the Gemini API server can’t properly interpret my request.


(API key in this image is already deleted!)

I’ve already confirmed that I have access to the gemini-2.0-flash-preview-image-generation model by sending the following request:

GET https://generativelanguage.googleapis.com/v1beta/models?key=YOUR_API_KEY

Also, when I send the exact same request in Postman, I get a valid base64 image result. This tells me that the issue is specific to n8n.

Here’s what I’ve already tried in n8n:

  • Set the Body Content Type to RAW, and pasted in the JSON body.
  • Turned Send Headers toggle on and manually added Content-Type: application/json.

Nothing works — the output always shows json:false.

I’ve discussed this with ChatGPT in detail and tried many different setups, but the conclusion even there was that this might be an internal issue with how n8n handles the request formatting.

Could anyone help me out here?

Thanks in advance! :folded_hands:

What is the error message (if any)?

The resource you are requesting could not be found

models/gemini-2.0-flash-preview-image-generation is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.

Please share your workflow

(API key in this node is already deleted!)

Information on your n8n setup

  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: window 11
1 Like

You might need to check your API KEY or generate a new one

I used your Request Node with my own Gemini API KEY and it’s working.

1 Like

Thank you!
Unfortunately, even when I generate a new API key — or create one using a completely different Google account — it still doesn’t work on my end.
I’m not sure why, but it seems to be a very specific or rare bug.
I think I’ll have to try a different method for generating images.

I’m having exactly the same error .Did you work out why this was happening ?

1 Like

I have the same problem. I’m usin n8n Cloud.
I have tried different approaches and nothing changed.

1 Like

having the same problem too. i thought it was no big deal, but meanwhile it looks like this is the reason my requests don’t work, since i’ve double and tripe checked everything else. please help

1 Like

I just faced the same problem today. Anyone found solution for that?

1 Like

I have the exact same bug on my end and therefore cannot send HTTP requests either. n8n please fix this error with the http node that always sends json: false no matter how you configure it.

2 Likes

Same here, running n8n locally.

Cannot use http POST requests with json because of this bug.
Please fix this.

1 Like

Same issue here. Self-hosting n8n and I’m trying to make a http request and whatever I try the request always has “json: false” which stops it from working.

The json:false is an internal option and is likely unrelated to this issue. Can we find out what the actual error response is when using the api?

I have managed to solve my issue, so json: false was not related. Seems @Jon is correct.

guys guys guys, I found out what the problems; your url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-preview-image-generation:generateContent?key=AIzaSyDE_k_EN7PO5FuAaXYHIqASNCjNVdbqMGM

is to generate content like text only. as the The model
gemini-2.0-flash-preview-image-generation does NOT support generateContent.

you should use POST https://generativelanguage.googleapis.com/v1beta/images:generate?key=your api key. so

main diff is
GET https://generativelanguage.googleapis.com/v1beta/models X
POST https://generativelanguage.googleapis.com/v1beta/images:generate O

hope this helpss :grin:

Pls check my reply