# AzureOpenAIImageBuilderExtensions

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.azureopenaiimagebuilderextensions/
> Summary: AzureOpenAIImageBuilderExtensions: Adds Azure OpenAI image generation to the Tracon chain.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Azure.dll</code></div>

Adds Azure OpenAI image generation to the Tracon chain.

```csharp
public static class AzureOpenAIImageBuilderExtensions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.azureopenaiimagebuilderextensions/">AzureOpenAIImageBuilderExtensions</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Methods

### <a id="Tracon_AzureOpenAIImageBuilderExtensions_UseAzureOpenAIImages_Tracon_ITraconBuilder_System_Action_Tracon_TraconImageOptions__"></a> UseAzureOpenAIImages\(ITraconBuilder, Action<TraconImageOptions\>?\)

Registers the Azure OpenAI image generator.

```csharp
public static ITraconBuilder UseAzureOpenAIImages(this ITraconBuilder builder, Action<TraconImageOptions>? configure = null)
```

#### Parameters

`builder` [ITraconBuilder](/api/tracon.itraconbuilder/)

The Tracon chain.

`configure` [Action](https://learn.microsoft.com/dotnet/api/system.action\-1)<[TraconImageOptions](/api/tracon.traconimageoptions/)\>?

Optional image-tool settings.

#### Returns

 [ITraconBuilder](/api/tracon.itraconbuilder/)

The continuation of the chain.

#### Remarks

Call [AzureOpenAIProviderExtensions.UseAzureOpenAI](/api/tracon.azureopenaiproviderextensions/)
first. The image model is an Azure deployment name, not a public model id.

```csharp
builder.AddTracon()
       .UseAzureOpenAI(
           new Uri(builder.Configuration["AzureOpenAI:Endpoint"]!),
           builder.Configuration["AzureOpenAI:ApiKey"]!)
       .UseAzureOpenAIImages(options =>
       {
           options.Enabled = true;
           options.Model = "image-deployment";
       });
```
