Skip to main content

Azure logoAzure

Azure is available through the AI SDK. Install the provider package to use their models with Mastra.

For detailed provider-specific documentation, see the AI SDK Azure provider docs.

Azure isn't a model router provider, so model strings like azure/<model> don't resolve. Pass a model instance from @ai-sdk/azure to the agent's model option instead.

Some router providers serve Azure-hosted models, for example llmgateway-providers/azure/gpt-5.4 from LLM Gateway and edenai/azure/gpt-4.1-nano from Eden AI. Use the full ID the provider lists, including its prefix. Dropping the prefix leaves an azure/... ID that doesn't resolve. To use your own Azure OpenAI deployments through the model router, register the Azure OpenAI gateway.

To use this provider with Mastra agents, see the Agent Overview documentation.

Installation
Direct link to Installation

npm install @ai-sdk/azure
On this page