web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Copilot Studio - General
Unanswered

Generating Images with Azure OpenAI from Power Automate / Copilot Studio (gpt-image-1)

(0) ShareShare
ReportReport
Posted on by 13

Hi guys,

 

I wanted to generate images from Copilot Studio, but I noticed this feature isn’t currently supported (it works in Copilot Studio Lite, though). So, I started researching alternatives using Azure AI Foundry and the Azure OpenAI Image API.

 

Here’s what I learned:

 

Why Azure OpenAI?

 

I can get OpenAI models to do Image Edits using an API directly in Azure, if you have an HuggingFace or Gemini API 🍌 you could use it 

 

How I Integrated It with Power Automate/Copilot Studio


  1. Create an Azure OpenAI resource in AI Foundry and enable the gpt-image-1 model.

  2. Get your endpoint and API key from Azure.

  3. In Power Automate, add an HTTP action:

    • Method: POST

    • URI: https://<your-resource>.openai.azure.com/openai/v1/images/edits

    • Headers:
      Authorization: Bearer <your-key>
      

    • Body: Use Form-data mode (recommended) and add:

      • image[] → File Content (from trigger or SharePoint)

      • prompt → e.g., an icon of a beef steak

      • modelgpt-image-1

      • size1024x1024

      • qualitymedium

      • output_formatpng

      • output_compression100

      • n1


      •  


    •  
{
  "$content-type": "multipart/form-data",
  "$multipart": [
    {
      "body": {
        "$content": "@{triggerBody()?['file']?['contentBytes']}",
        "$content-type": "image/png"
      },
      "headers": {
        "Content-Disposition": "form-data; name=\"image[]\"; filename=\"file.png\""
      }
    },
    {
      "body": "an icon of a beef stake",
      "headers": {
        "Content-Disposition": "form-data; name=\"prompt\""
      }
    },
    {
      "body": "gpt-image-1",
      "headers": {
        "Content-Disposition": "form-data; name=\"model\""
      }
    },
    {
      "body": "1024x1024",
      "headers": {
        "Content-Disposition": "form-data; name=\"size\""
      }
    },
    {
      "body": "1",
      "headers": {
        "Content-Disposition": "form-data; name=\"n\""
      }
    },
    {
      "body": "medium",
      "headers": {
        "Content-Disposition": "form-data; name=\"quality\""
      }
    },
    {
      "body": "100",
      "headers": {
        "Content-Disposition": "form-data; name=\"output_compression\""
      }
    },
    {
      "body": "png",
      "headers": {
        "Content-Disposition": "form-data; name=\"output_format\""
      }
    }
  ]
}
 
 
 
the body part can be: 
      "body": {
        "$content": "@{triggerBody()?['file']?['contentBytes']}",
        "$content-type": "image/png"
      },
or
 
 

Power Automate will handle the multipart boundaries automatically.

 

 

Some issues that I experiment


  • Don’t use JSON body with Content-Type: application/json. The API requires multipart/form-data.

  • Avoid base64ToString()—send the Base64 content directly from Get file content.

  • If you see 400 Bad Request, check that your headers and body format match the API requirements.
 
Sources:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Copilot Studio

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 312 Super User 2025 Season 2

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 278 Super User 2025 Season 2

#3
Sam_Fawzi Profile Picture

Sam_Fawzi 76 Super User 2025 Season 2

Last 30 days Overall leaderboard