Struggling with a workflow I’m currently working on.
I’m trying to generate an image using OpenAI and an HTTP request. I’m using the following JSON body in the HTTP request body parameter:
{
“model”: “gpt-image-1”,
“prompt”: “{{ $json.output }}”,
“n”: 1,
“size”: “1536x1024”
}
I’m mapping “{{ $json.output }}” from what the previous node generated. But as it goes through the “Convert to file” node, I repeatedly receive this message:
“The value in “data[0].b64_json” is not set”
I assume there’s something missing from the previous node. Maybe I’m mapping incorrectly, not sure.
Any guidance and help is appreciated, thanks!
gpt-image-1 return array in result
Even you sent n=1. It’s still return an array.
Need to split out first
Here is my workflow
Was going to try what you suggested, but ran into this instead with the below error message. My openAI account is active, so not sure why this is happening. Thanks!
{ “status”: 429, “headers”: { “alt-svc”: “h3=":443"; ma=86400”, “cf-cache-status”: “DYNAMIC”, “cf-ray”: “94a9f28abd39975d-FRA”, “connection”: “keep-alive”, “content-length”: “223”, “content-type”: “application/json; charset=utf-8”, “date”: “Wed, 04 Jun 2025 19:48:23 GMT”, “server”: “cloudflare”, “set-cookie”: “__cf_bm=HwYG4pgSipoLOpx5W67aHj.SDtMe1lA2zOzAXvypabM-1749066503-1.0.1.1-zpIvDCN3ktCi3M08KtjAMat4CbPLNJC01GOqfZWg.PhqyE3qr2kjyZoVEzbEfORtGZQ0eh944Uf42_Uh3Nsxt58jpDlVfVRHoCAcEpFK1Sk; path=/; expires=Wed, 04-Jun-25 20:18:23 GMT; domain=.api.openai.com ; HttpOnly; Secure; SameSite=None, _cfuvid=3fzCCrb2oBg0dujDPRMTh9YWQXhUabbdQiYHJ7JP.DE-1749066503430-0.0.1.1-604800000; path=/; domain=.api.openai.com ; HttpOnly; Secure; SameSite=None”, “strict-transport-security”: “max-age=31536000; includeSubDomains; preload”, “vary”: “Origin”, “x-content-type-options”: “nosniff”, “x-request-id”: “req_3ee619383d29bf88ada8ae2c37359ce3” }, “request_id”: “req_3ee619383d29bf88ada8ae2c37359ce3”, “error”: { “message”: “Your account is not active, please check your billing details on our website.”, “type”: “billing_not_active”, “param”: null, “code”: “billing_not_active” }, “code”: “billing_not_active”, “param”: null, “type”: “billing_not_active”, “lc_error_code”: “MODEL_RATE_LIMIT”, “attemptNumber”: 3, “retriesLeft”: 0 }
Looks like you reach rate limit
OpenAI treat different level for different rate limit
Take Free tier for example.
If you are using 4o-mini
Request per minute is 3 times
Request per day is 200 times
So you might need to check your tier and check the rate limit of the model you are using
https://platform.openai.com/docs/guides/rate-limits
https://platform.openai.com/docs/models/gpt-4o-mini
Thanks Darrell. I was able to get past it with your help. Now that I’m back to the main issue, I receive the following output error in the node before “Convert to file”:
“JSON parameter needs to be valid JSON”
This is my JSON body, and I’m mapping the output parameter under “Image prompt generator”:
{
“model”: “gpt-image-1”,
“prompt”: “{{ $json.output }}”,
“n”: “1”,
“size”: “1536x1024”
}
Trying to understand where I’m messing up. Maybe the output parameter is mapped incorrectly?
That’s because your prompt is not a valid json
You might need to control the previous AI [Image prompt generator] to make sure it gave you the right json string format
without the ```json ... ```
Then you can convert it to a valid json string.
Oh gotcha, didn’t even catch that.
Not sure why the image prompt generator is outputting it in that format. These are the prompts I’m using and I can’t see where or why this is occurring.
Content: {{json.linkedin_post}}
For the given post content, generate 1–2 short, vivid image prompts that visually capture the core idea. Each should include:
A short OpenAI-friendly prompt (20 words or less)
A clear visual style (flat, 3D, cinematic, sketch, vaporwave, etc.)
A suggested format (square, portrait, wide)
Output JSON format:
{
“image_prompt”: “…”,
“style”: “…”,
“format”: “…”
}
And then this system message:
Include a visual style (e.g. isometric, flat vector, cinematic photo, watercolor sketch)
Include a suggested format (e.g. square, 16:9 wide, vertical portrait)
Have you figured out this issue? I’m getting “JSON parameters need to be valid JSON”
I saw you use output parser. What’s inside
If I put this in output parser. Work perfectly
@Patrick_Morgan
Invalid json could be many reasons. You might need to share the screenshot about the content inside.
Here is another solution for other invalid json related issue.
try
{
"model": "Qubico/flux1-dev",
"task_type": "txt2img",
"input": {
"prompt": {{ $json.message.content.toJsonString() }},
"width": 540,
"height": 960
}
}
I switch Specific Body to Use Body Below, and added the json event there.
system
Closed
September 16, 2025, 12:58am
12
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.