AI agents · OpenClaw · self-hosting · automation

Quick Answer

How to Use Microsoft MAI Models on Foundry (2026)

Published:

How to Use Microsoft MAI Models on Foundry

A practical guide to using Microsoft’s MAI-Transcribe-1, MAI-Voice-1, and MAI-Image-2 models.

Last verified: April 2026

What You Get

ModelPurposeStatus
MAI-Transcribe-1Speech-to-textPublic preview
MAI-Voice-1Text-to-speechPublic preview
MAI-Image-2Image generationPublic preview

All three are in public preview on Microsoft Foundry (Azure) and MAI Playground.

Option 1: MAI Playground (Quick Start)

  1. Go to microsoft.ai/playground
  2. Sign in with your Microsoft account
  3. Pick a model (Transcribe, Voice, or Image)
  4. Try it with a prompt or upload audio
  5. See real-time output

Perfect for exploring capabilities before committing to API integration.

Option 2: Azure Foundry (Production)

Step 1: Set Up Azure Foundry

# Install Azure CLI if you don't have it
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

# Login
az login

# Create a Foundry resource
az cognitiveservices account create \
  --name my-foundry \
  --resource-group my-rg \
  --kind AIFoundry \
  --sku S0 \
  --location eastus

Step 2: Get Your API Key

az cognitiveservices account keys list \
  --name my-foundry \
  --resource-group my-rg

Step 3: Call the APIs

MAI-Image-2:

curl -X POST https://my-foundry.cognitiveservices.azure.com/v1/images/generations \
  -H "api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mai-image-2",
    "prompt": "a futuristic city at sunset, cinematic lighting",
    "size": "1024x1024",
    "n": 1
  }'

MAI-Transcribe-1:

curl -X POST https://my-foundry.cognitiveservices.azure.com/v1/audio/transcriptions \
  -H "api-key: YOUR_KEY" \
  -F "model=mai-transcribe-1" \
  -F "[email protected]"

MAI-Voice-1:

curl -X POST https://my-foundry.cognitiveservices.azure.com/v1/audio/speech \
  -H "api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mai-voice-1",
    "input": "Hello, this is MAI-Voice-1 speaking.",
    "voice": "alloy"
  }' \
  --output speech.mp3

Pricing (Public Preview)

Microsoft hasn’t published final pricing. Preview pricing is aggressive — typically undercutting OpenAI equivalents by 20-40%. Check foundry.microsoft.com for current pricing.

Python SDK Example

from openai import AzureOpenAI

client = AzureOpenAI(
    api_key="YOUR_KEY",
    api_version="2024-12-01-preview",
    azure_endpoint="https://my-foundry.cognitiveservices.azure.com"
)

# Generate image with MAI-Image-2
response = client.images.generate(
    model="mai-image-2",
    prompt="a futuristic city at sunset",
    size="1024x1024",
    n=1
)
print(response.data[0].url)

When to Use MAI vs Alternatives

ScenarioPick
Azure-heavy orgMAI models
Microsoft 365 integrationMAI models
Need OpenAI’s ecosystemAzure OpenAI
Maximum quality (art)Midjourney
Open sourceStable Diffusion / Flux

Tips

  • Start in Playground — Test prompts before writing code
  • Use streaming — For voice and transcription, stream for better UX
  • Monitor quota — Preview has lower rate limits than production
  • Pin API version — Preview APIs change; pin specific versions

Last verified: April 2026