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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Generating Images with...
Copilot Studio
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:
copilot studio gpt image.png
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,969 Moderator on at
    Hi :-)
     
    Thank you for sharing!!
  • Romain The Low-Code Bearded Bear Profile Picture
    2,562 Super User 2026 Season 1 on at
    nice sharing, great to make this. very nice to share with the community, thank you :)
     
    Just why not using AI Builder Prompt (named "prompt" from copilot studio tools) , enable code interpretor and then ask image generation ? work well :) this could not generate impressive image like dall-e or sora but for pro content like charts and graph it work very well :) (and it use copilot studio credit, and don't need an azure subscription)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 594

#2
chiaraalina Profile Picture

chiaraalina 170 Super User 2026 Season 1

#3
deepakmehta13a Profile Picture

deepakmehta13a 118

Last 30 days Overall leaderboard