Microsoft Foundry Plugin for OpenClaw - Model Provider Support

This page covers the Microsoft Foundry plugin for OpenClaw, including installation, authentication, and chat model configuration. It is intended for developers integrating Microsoft Foundry or Azure AI Foundry resources.

Read this when

  • You are installing, configuring, or auditing the microsoft-foundry plugin

Microsoft Foundry plugin

OpenClaw gains Microsoft Foundry model provider support through this plugin.

Distribution

  • Package: @openclaw/microsoft-foundry
  • Installation method: bundled with OpenClaw

Surface

providers: microsoft-foundry; contracts: imageGenerationProviders

  • Image generation provider: microsoft-foundry

Requirements

  • A Microsoft Foundry or Azure AI Foundry resource with active deployments.
  • Authentication via AZURE_OPENAI_API_KEY using an API key or a configured provider API key.
  • For Entra ID authentication, have the Azure CLI installed and execute az login before starting. OpenClaw refreshes Microsoft Foundry runtime tokens using az account get-access-token.

Chat models

Chat deployments in Microsoft Foundry use the provider model reference microsoft-foundry/<deployment-name>. During onboarding, the Azure CLI discovers Foundry resources and deployments, and the chosen deployment name is written to the model configuration.

OpenClaw calls the Foundry /openai/v1 endpoint for OpenAI compatible chat APIs:

  • GPT, o*, computer-use-preview, and DeepSeek-V4 model families use openai-responses by default.
  • MAI-DS-R1 and other chat completion deployments use openai-completions unless a supported API is explicitly configured.
  • MAI-DS-R1 is marked as reasoning capable through reasoning content, not through reasoning_effort. Its context and output token metadata is 163,840 tokens.

Anthropic Claude deployments within Microsoft Foundry follow the Anthropic Messages API format rather than the OpenAI compatible /openai/v1 format. Set these up as a custom anthropic-messages provider until the Microsoft Foundry plugin gains native Anthropic runtime support. When the Foundry deployment name does not match the Claude model ID, set params.canonicalModelId on the model entry so OpenClaw can apply model specific wire contracts, correctly map /think off, and safely preserve signed thinking.

MAI image generation

The plugin registers microsoft-foundry for image_generate with the current Microsoft AI image models:

  • MAI-Image-2.5-Flash
  • MAI-Image-2.5
  • MAI-Image-2e
  • MAI-Image-2

Use a deployed MAI image deployment name as the model reference. No default image model is declared by the provider because the MAI API requires your deployment name in the request model field:

{
  agents: {
    defaults: {
      imageGenerationModel: {
        primary: "microsoft-foundry/<deployment-name>",
        timeoutMs: 600000,
      },
    },
  },
}

Prompt only generation calls Microsoft Foundry's MAI generations endpoint: /mai/v1/images/generations. Edits using a reference image call /mai/v1/images/edits and are restricted to MAI-Image-2.5-Flash and MAI-Image-2.5 deployments.

For prompt only generation, a custom deployment name can be used with only the Foundry endpoint configured. For image edits with a custom deployment name, either select the deployment through onboarding or include model metadata so OpenClaw can confirm the deployment is backed by MAI-Image-2.5-Flash or MAI-Image-2.5.

MAI image constraints:

  • Output: one PNG image per request.
  • Size: default 1024x1024; both width and height must be at least 768 px.
  • Total pixels: width × height cannot exceed 1,048,576.
  • Edits: one PNG or JPEG input image.
  • Unsupported shared hints like aspectRatio, resolution, quality, background, and non-PNG outputFormat are not forwarded to Microsoft Foundry.

Troubleshooting

  • az: command not found: install the Azure CLI or use API key authentication.
  • Microsoft Foundry endpoint missing for MAI image generation: choose a Foundry deployment via onboarding or add models.providers.microsoft-foundry.baseUrl.
  • supports MAI image deployments only: the selected image model points to a non-MAI deployment. Use a deployed MAI image model for image_generate.