new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

azure/capabilities

32 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Azure provider language model creation

Create a language model by calling the azure provider instance with the deployment name as the first argument: `const model = azure('your-deployment-name');`

Azure chat model factory method

Create models that call the Azure OpenAI chat completions API using the `.chat()` factory method: `const model = azure.chat('your-deployment-name');` The URL for calling Azure chat models is constructed as: https://RESOURCE_NAME.openai.azure.com/openai/v1/chat/completions?api-version=v1

Azure chat model provider options

Azure OpenAI chat models support the following provider options via `providerOptions.openai`: logitBias (Record<number, number> to modify token likelihood from -100 to 100), logprobs (boolean or number to return log probabilities), parallelToolCalls (boolean, defaults to true), and user (string for end-user identifier).

Azure DeepSeek chat model factory

Create Azure-hosted DeepSeek chat models using the `.deepseek()` factory method: `const model = azure.deepseek('your-deepseek-deployment-name');` Use this factory for Azure DeepSeek models like deepseek-v4-pro and deepseek-v4-flash that support reasoning fields. The factory maps top-level `reasoning` to DeepSeek `reasoning_effort` and parses streamed `reasoning_content` as AI SDK reasoning parts.

Azure Responses API default model factory

Azure OpenAI uses the Responses API as default with the `azure(deploymentName)` factory method. Further configuration can be done using OpenAI provider options. The providerMetadata is only returned with the default responses API, not when using 'azure.chat' or 'azure.completion'.

Azure Responses API provider options

The Responses API supports the following provider options via `providerOptions.azure` (the 'openai' key is still supported for input): parallelToolCalls (boolean, defaults to true), store (boolean, defaults to true), metadata (Record<string, string>), previousResponseId (string to continue conversation), instructions (string for system/developer message), user (string for end-user identifier), reasoningEffort ('low' | 'medium' | 'high', defaults to medium), and strictJsonSchema (boolean, defaults to false).

Azure Responses API metadata returned

The Responses API returns provider-specific metadata that can be typed using `AzureResponsesProviderMetadata`. The metadata includes: responseId (string | null | undefined, can be used for previousResponseId), logprobs (optional, log probabilities of output tokens), and serviceTier (optional, service tier information).

Azure web search tool via Responses API

The Azure OpenAI responses API supports web search through `azure.tools.webSearch()`. Configuration options include: externalWebAccess (boolean, defaults to true), searchContextSize ('low' | 'medium' | 'high'), userLocation (object with type 'approximate', and optional country, city, region, timezone), and filters (object with allowedDomains and blockedDomains arrays, up to 100 each). Domain filters should omit HTTP/HTTPS prefix, and subdomains are automatically included or excluded.

Azure file search tool via Responses API

The Azure OpenAI provider supports file search through `azure.tools.fileSearch()`. The tool must be named 'file_search' (required by Azure OpenAI API). Configuration options include: vectorStoreIds (array of vector store IDs), maxNumResults (number), and ranking (object with ranker property). The tool is only supported with the default responses API, not with 'azure.chat' or 'azure.completion'.

Azure image generation tool via Responses API

Azure OpenAI Responses API supports image generation as `azure.tools.imageGeneration()`. Configuration: outputFormat can be 'png'. The tool must be named 'image_generation'. Availability is restricted to specific models like gpt-5 variants. Requires an image generation model deployment specified in header 'x-ms-oai-image-generation-deployment'. Both the Responses API model and image generation model must be in the same resource. Only supported with default responses API, not with 'azure.chat' or 'azure.completion'. When using store: false, previously generated images will not be accessible.

Azure code interpreter tool via Responses API

The Azure OpenAI provider supports code interpreter through `azure.tools.codeInterpreter()`. This allows models to write and execute Python code. Configuration includes optional container property (either string container ID or object with fileIds array to specify uploaded files). The tool must be named 'code_interpreter'. Only supported with default responses API, not with 'azure.chat' or 'azure.completion'.

Azure PDF file support

Azure OpenAI provider supports reading PDF files by passing files as part of message content using type 'file'. Set mediaType to 'application/pdf', pass PDF data in the data field (e.g., fs.readFileSync('./data/ai.pdf')), and optionally include filename. The model will have access to PDF contents. Reading PDF files is only supported with default responses API, not with 'azure.chat' or 'azure.completion'.

Azure Responses API text part metadata

When using Azure OpenAI Responses API, SDK attaches Azure-specific metadata to text output parts via `providerMetadata` as `AzureResponsesTextProviderMetadata`. Metadata includes: itemId (ID of output item in Responses API) and annotations (optional array of annotation objects). Annotation types include url_citation, file_citation, container_file_citation, and file_path, matching OpenAI Responses API specification.

Azure Responses API reasoning part metadata

Reasoning output parts in Azure OpenAI Responses API include provider metadata as `AzureResponsesReasoningProviderMetadata`. Metadata includes: itemId (ID of reasoning item) and reasoningEncryptedContent (optional, encrypted reasoning content returned only when requested via include: ['reasoning.encrypted_content']).

Azure Responses API source document metadata

For source document parts (part.type === 'source' and sourceType === 'document'), providerMetadata is provided as `AzureResponsesSourceDocumentProviderMetadata`, a discriminated union with type field. Supported types: file_citation, container_file_citation, and file_path. SDK normalizes metadata to camelCase (fileId, containerId) unlike text annotations which use snake_case.

Azure completion model factory

Create models that call the completions API using `.completion()` factory method: `const model = azure.completion('your-gpt-35-turbo-instruct-deployment');` Currently only gpt-35-turbo-instruct is supported.

Azure completion model provider options

Azure OpenAI completion models support the following optional provider options via `providerOptions.openai`: echo (boolean, echo prompt in addition to completion), logitBias (Record<number, number> to modify token likelihood from -100 to 100), logprobs (boolean or number to return log probabilities), suffix (string that comes after completion), and user (string for end-user identifier).

Azure embedding model factory

Create models that call the Azure OpenAI embeddings API using `.embedding()` factory method: `const model = azure.embedding('your-embedding-deployment');`

Azure embedding model provider options

Azure OpenAI embedding models support the following optional provider options via `providerOptions.openai`: dimensions (number for resulting output embedding dimensions, only supported in text-embedding-3 and later models) and user (string for end-user identifier).

Azure image generation model factory

Create models that call the Azure OpenAI image generation API (DALL-E) using `.image()` factory method: `const model = azure.image('your-dalle-deployment-name');` where the argument is your deployment name for the DALL-E model.

Azure image generation model provider options

Azure OpenAI image models support provider options via `providerOptions.openai` of type `OpenAIImageModelGenerationOptions`, including: user (string for end-user identifier).

Azure DALL-E model capabilities and sizes

Azure OpenAI supports DALL-E 2 and DALL-E 3 models. DALL-E 3 supports sizes: 1024x1024, 1792x1024, 1024x1792. DALL-E 2 supports sizes: 256x256, 512x512, 1024x1024. DALL-E models do not support the aspectRatio parameter; use the size parameter instead. When creating the Azure deployment, set the DALL-E model version you want to use.

Azure transcription model factory

Create models that call the Azure OpenAI transcription API using `.transcription()` factory method: `const model = azure.transcription('whisper-1');` where the first argument is the model id.

Azure transcription model provider options

Azure OpenAI transcription models support the following provider options via `providerOptions.openai`: timestampGranularities (string array, defaults to ['segment'], possible values are 'word', 'segment', or both), language (string in ISO-639-1 format like 'en' to improve accuracy and latency), prompt (string to guide model style or continue previous segment), temperature (number between 0 and 1, defaults to 0), and include (string array for additional information in response).

Azure transcription model capabilities

Azure OpenAI transcription models support: whisper-1 (Transcription: Yes, Duration: Yes, Segments: Yes, Language: Yes), gpt-4o-mini-transcribe (Transcription: Yes, Duration: No, Segments: No, Language: No), gpt-4o-transcribe (Transcription: Yes, Duration: No, Segments: No, Language: No).

Azure speech model factory

Create models that call the Azure OpenAI speech API using `.speech()` factory method: `const model = azure.speech('your-tts-deployment-name');` where the first argument is your deployment name for the text-to-speech model (e.g., 'tts-1').

Azure TTS model capabilities

Azure OpenAI supports TTS models: tts-1 (Instructions: No), tts-1-hd (Instructions: No), gpt-4o-mini-tts (Instructions: Yes).

Azure reasoning model extraction middleware

Azure exposes thinking of DeepSeek-R1 in generated text using the `<think>` tag. Use the `extractReasoningMiddleware` to extract reasoning and expose it as a `reasoning` property on the result. Example: `wrapLanguageModel({ model: azure('your-deepseek-r1-deployment-name'), middleware: extractReasoningMiddleware({ tagName: 'think' }) })`

Azure streaming performance note

Azure OpenAI sends larger chunks than OpenAI, which can lead to the perception that the response is slower when streaming. See troubleshooting documentation on Azure OpenAI Slow To Stream.

Azure Responses API default behavior

The Azure provider calls the Responses API by default (unless you specify e.g. `azure.chat`). When using the Responses API, use `azure` as the provider name in `providerOptions` instead of `openai`. The `openai` key is still supported for `providerOptions` input.

Azure generateText example with deployment name

Example of using Azure OpenAI language models to generate text: `const { text } = await generateText({ model: azure('your-deployment-name'), prompt: 'Write a vegetarian lasagna recipe for 4 people.' });`

Azure structured data generation support

Azure OpenAI language models support structured data generation with Output and can be used in generateText and streamText functions as documented in AI SDK Core.

Give your agent this brain