Principle:Mistralai Client python Azure Client Initialization
| Knowledge Sources | |
|---|---|
| Domains | Cloud_Deployment, Azure, API_Client |
| Last Updated | 2026-02-15 14:00 GMT |
Overview
A cloud-specific client initialization pattern that configures an API client for Mistral models deployed on Azure AI infrastructure with Azure-specific authentication and endpoint routing.
Description
Azure Client Initialization creates a MistralAzure client instance configured for Mistral models deployed through Azure AI. Unlike the standard Mistral client, the Azure client requires an azure_endpoint (the Azure AI deployment URL) and an azure_api_key (from the Azure portal). The client automatically normalizes the endpoint URL by appending /v1/ if not present, and uses a custom User-Agent hook to identify requests as coming from the Azure SDK variant.
Usage
Use this principle when accessing Mistral models deployed via Azure AI rather than the standard Mistral API. Requires an active Azure subscription with a deployed Mistral model. The MistralAzure client supports .chat and .ocr sub-SDKs but not embeddings or fine-tuning (which are only available through the standard API).
Theoretical Basis
Azure deployment differs from direct API access:
- Endpoint routing: Azure endpoints have a different URL structure than api.mistral.ai
- Authentication: Uses Azure-specific API keys (not Mistral API keys)
- URL normalization: The SDK auto-appends /v1/ to ensure correct endpoint format
- User-Agent tagging: Custom hook identifies requests as Azure SDK traffic