Microsoft PowerAutomte failed HTTP request to Dall-e-3

Hello,

I’m writing a PowerAutomate flow within CoPilot Studio to allow the user to generate an image. When testing the flow, I am continuously getting an HTTP error. It varies from Bad Gateway to Bad Request to Flow Failed to Start. That said, it all seems to point to the HTTP request.

Here is my code, extracted from PowerAutomate HTTP connector:

{
"type": "Http",
"inputs": {
"uri": "https://api.openai.com/v1/images/generations",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer sk-proj-mysecret"
},
"body": {
"model": "dall-e-3",
"prompt": "@{triggerBody()?['text']}in the style of @{triggerBody()?['text_1']}",
"n": 1,
"size": "1024x1024"
}
},
"runAfter": {},
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
}
}
}

This is the error message that the agent is returning when testing:

Error Message: The flow with id c61d86eb-ad4c-f011-877a-00224802f8c7 has timed out. Error Code: FlowActionTimedOut Conversation Id: a4dc6a5a-e962-4ef9-b212-4c1989ab7bd3 Time (UTC): 2025-06-19T11:29:31.611Z

These are the raw inputs of what PowerAutomate passed into the variables that were passed into the prompt

{
    "uri": "https://api.openai.com/v1/images/generations",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "*sanitized*"
    },
    "body": {
        "model": "dall-e-3",
        "prompt": "in the style of ",
        "n": 1,
        "size": "1024x1024"
    }
}

This is what the output variable returned:

 {
    "statusCode": 400,
    "headers": {
        "Date": "Thu, 19 Jun 2025 11:40:55 GMT",
        "Connection": "keep-alive",
        "openai-version": "2020-10-01",
        "openai-organization": "gemcityx",
        "X-Request-ID": "req_b06a5de31574e82efd24cb0ceb2aa61e",
        "openai-processing-ms": "118",
        "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
        "cf-cache-status": "DYNAMIC",
        "Set-Cookie": "__cf_bm=4W4It7WSKf6w8vrVljqoUcGlgkcvADd19jvqga0Nhfo-1750333255-1.0.1.1-c05uPAUxc3srRKsmScTGEA52AWhCiA7RU.94_LgSuUv1zgrghWNiFvHBJmUSRs9cuDXbBKYb6b4yACjN6v5gBAIWzErZAf4EkcQqC3twIYo; path=/; expires=Thu, 19-Jun-25 12:10:55 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None,_cfuvid=8umYL3CWlm3vIXM7K7juOlk1ltGAnQJ.B8Px4nUWrfY-1750333255386-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None",
        "X-Content-Type-Options": "nosniff",
        "Server": "cloudflare",
        "CF-RAY": "9522c11d3802679b-SJC",
        "Alt-Svc": "h3=\":443\"",
        "Content-Type": "application/json",
        "Content-Length": "120"
    },
    "body": {
        "error": {
            "message": null,
            "type": "image_generation_user_error",
            "param": null,
            "code": null
        }
    }
}