- The image generation tool requires the
gpt-image-1model. See the Azure OpenAI transparency note for limitations and responsible AI considerations. - You also need a compatible orchestrator model deployed in the same Foundry project. See Tool support by region and model.
Prerequisites
- An Azure account with an active subscription.
- A Foundry project.
- A basic or standard agent environment. See agent environment setup.
- Foundry User role on the Foundry project to create and manage agent versions.
The Foundry RBAC roles were recently renamed. Foundry User, Foundry Owner, Foundry Account Owner, and Foundry Project Manager were previously named Azure AI User, Azure AI Owner, Azure AI Account Owner, and Azure AI Project Manager. You might still see the previous names in some places while the rename rolls out. The role IDs and core permissions are unchanged by the rename.
- Approval to use
gpt-image-1. Apply for access to GPT Image models before you deploy the model. - Two model deployments in the same Foundry project:
- A compatible Azure OpenAI model deployment for the agent (for example,
gpt-5). - An image generation model deployment (
gpt-image-1) in a supported region.
- A compatible Azure OpenAI model deployment for the agent (for example,
Usage support
The following table shows SDK and setup support.Configure the image generation tool
- Deploy your orchestrator model (for example,
gpt-5) to your Foundry project. - Deploy
gpt-image-1to the same Foundry project. - Confirm your region and model support for image generation. See Best practices for using tools in Microsoft Foundry Agent Service.
Code examples
Use the runtime and install command in your selected language section. The .NET SDK is currently in preview. For general SDK setup, see the quickstart.When to use the image generation tool
Use the image generation tool when an agent needs to generate an image from a text prompt as part of a conversation or multistep workflow. Use the Azure OpenAI Image API directly for image editing, masks, or partial-image streaming.Optional parameters
Customize image generation by specifying these optional parameters when you create the tool:Image generation time varies based on the
quality setting and prompt complexity. For time-sensitive applications, consider using quality: "low".- Build conversational image experiences with GPT Image.
- Include image generation in a multistep agent workflow.
Write effective text-to-image prompts
Effective prompts produce better images. Describe the subject, visual style, and composition you want. Use action words like “draw,” “create,” or “edit” to guide the model’s output. Content filtering can block image generation if the service detects unsafe content in your prompt. For more information, see Guardrails and controls overview.Verify tool execution
Use either of these approaches to confirm that image generation ran successfully:- In the response payload, look for an output item with
typeset toimage_generation_call. - In the Foundry portal, open tracing/debug for your run to confirm the tool call and inspect inputs and outputs.
image_generation_call output item with a result field containing base64-encoded image data.
If you see only text output and no image_generation_call item, the request might not be routed to image generation. Review the troubleshooting section.