new·Earn with mozg — 20% of every monthSend somebody here and take a fifth of every plan payment they make, for as long as they keep paying — not a bounty on the first invoice. Your handle is the link, the window is thirty days, and the commission lands on your balance the second they pay. Free to join: if you have signed in, you already have the link. mozg.sh/earnall news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

azure/options

21 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 useDeploymentBasedUrls option

Set `useDeploymentBasedUrls: true` to use the legacy deployment-based URL format: `{baseURL}/deployments/{deploymentId}{path}?api-version={apiVersion}` instead of the default `{baseURL}/v1{path}?api-version={apiVersion}`. This option is useful for compatibility with certain Azure OpenAI models or deployments that require the legacy endpoint format. Defaults to `false`.

Azure provider headers and fetch options

The `headers` parameter accepts `Record<string, string>` for custom headers to include in requests. The `fetch` parameter accepts a custom fetch implementation with signature `(input: RequestInfo, init?: RequestInit) => Promise<Response>`. You can use fetch as middleware to intercept requests or provide a custom implementation for testing.

Azure OpenAI language model provider options

When using Azure OpenAI language models with `generateText`, configure provider-specific options using `providerOptions.openai`. These options are identical to the OpenAI provider and include settings like `reasoningEffort`, `imageDetail`, and other OpenAI-specific configurations. Validate options using the `OpenAILanguageModelResponsesOptions` type.

Azure chat model provider options: logitBias

The `logitBias` option is a `Record<number, number>` that modifies the likelihood of specified tokens appearing in the completion. Maps token IDs to bias values from -100 to 100. The bias is added to logits prior to sampling. Values between -1 and 1 decrease or increase likelihood; values like -100 or 100 ban or exclusively select the token. Example: `{ '50256': -100 }` prevents the token from being generated.

Azure chat model provider options: logprobs

The `logprobs` option is `boolean | number`. Set to `true` to return log probabilities of generated tokens. Set to a number to return log probabilities of the top n tokens. Including logprobs increases response size and can slow down response times but helps understand model behavior.

Azure chat model provider options: parallelToolCalls and user

The `parallelToolCalls` option is a boolean that enables parallel function calling during tool use; defaults to `true`. The `user` option is a string representing a unique end-user identifier to help monitor and detect abuse.

Azure responses model provider options

For Azure responses models, use `providerOptions.azure` with the following options: `parallelToolCalls` (boolean, default `true`), `store` (boolean, default `true`), `metadata` (Record<string, string>), `previousResponseId` (string), `instructions` (string), `user` (string), `reasoningEffort` ('low' | 'medium' | 'high', default `medium`), and `strictJsonSchema` (boolean, default `false`). When `store: false`, previously generated images will not be accessible by the model.

Azure web search tool configuration

The `azure.tools.webSearch()` tool supports the following options: `externalWebAccess` (boolean, default `true`), `searchContextSize` ('low' | 'medium' | 'high'), `userLocation` (object with `type: 'approximate'`, `country`, `city`, `region`, `timezone`), and `filters` (object with `allowedDomains` and `blockedDomains`, each up to 100 domains). Omit HTTP/HTTPS prefix from domain filters; subdomains are automatically included or excluded. On Microsoft Foundry, external web access is not supported and `externalWebAccess` is ignored.

Azure file search tool configuration

The `azure.tools.fileSearch()` tool supports the following options: `vectorStoreIds` (string array), `maxNumResults` (number), and `ranking` (object with `ranker: 'auto'`). The tool must be named `file_search` when using Azure OpenAI's file search functionality; this name is required and cannot be customized. File search is only supported with the default responses API, not with `azure.chat` or `azure.completion`.

Azure image generation tool configuration

The `azure.tools.imageGeneration()` tool supports `outputFormat: 'png'` option. To use image generation, set the header `x-ms-oai-image-generation-deployment` with your image model deployment name. The tool must be named `image_generation` and cannot be customized. Both the responses API model and image generation model must be in the same resource. Image generation is only supported with the default responses API, not with `azure.chat` or `azure.completion`. When `store: false`, previously generated images will not be accessible.

Azure code interpreter tool configuration

The `azure.tools.codeInterpreter()` tool can optionally be configured with a `container` parameter that is either a container ID string or an object with `fileIds` to specify uploaded files available to the interpreter. The tool must be named `code_interpreter` and cannot be customized. Code interpreter is only supported with the default responses API, not with `azure.chat` or `azure.completion`. Files generated by the Code Interpreter can be referenced using `container_id` and `file_id` from `providerMetadata` via the Retrieve container file content API.

Azure embedding model provider options

For Azure embedding models, use `providerOptions.openai` with: `dimensions` (number, optional) - the number of dimensions for the output embedding (only supported in text-embedding-3 and later); `user` (string, optional) - unique end-user identifier.

Azure image generation model sizes and capabilities

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 deployments, set the DALL-E model version you want to use.

Azure image generation provider options

For Azure image generation, use `providerOptions.openai` with `user` (string, optional) - unique end-user identifier.

Azure transcription model provider options

For transcription models, use `providerOptions.openai` with: `timestampGranularities` (string[], default `['segment']`) - values can be `['word']`, `['segment']`, or `['word', 'segment']`; `language` (string, optional) - ISO-639-1 format (e.g., 'en') improves accuracy and latency; `prompt` (string, optional) - text to guide style or continue previous audio segment; `temperature` (number, 0-1, default 0) - higher values make output more random; `include` (string[], optional) - additional information to include in response.

Azure speech model provider options

For speech models, use `providerOptions.openai` with: `instructions` (string, optional) - control voice with additional instructions like 'Speak in a slow and steady tone' (does not work with `tts-1` or `tts-1-hd`); `speed` (number, 0.25-4.0, default 1.0) - the speed of generated audio.

Azure completion model provider options

For completion models, use `providerOptions.openai` with: `echo` (boolean) - echo back the prompt in addition to the completion; `logitBias` (Record<number, number>) - bias values from -100 to 100 for specific tokens; `suffix` (string) - text that comes after a completion; `logprobs` (boolean | number) - return log probabilities; `user` (string) - unique end-user identifier.

Azure responses text part metadata: AzureResponsesTextProviderMetadata

When using Azure OpenAI Responses API, text parts include `providerMetadata` of type `AzureResponsesTextProviderMetadata` with fields: `itemId` (string) - ID of the output item in Responses API; `annotations` (optional array) - annotation objects with `type` field. Annotation types include `url_citation`, `file_citation`, `container_file_citation`, `file_path`. These correspond to Responses API annotation objects for reference rendering or output analysis.

Azure responses reasoning part metadata: AzureResponsesReasoningProviderMetadata

When using Azure OpenAI Responses API, reasoning parts include `providerMetadata` of type `AzureResponsesReasoningProviderMetadata` with fields: `itemId` (string) - ID of the reasoning item; `reasoningEncryptedContent` (optional string) - encrypted reasoning content only returned when requested via `include: ['reasoning.encrypted_content']`.

Azure responses source document part metadata: AzureResponsesSourceDocumentProviderMetadata

For source document parts with `sourceType === 'document'`, `providerMetadata` is of type `AzureResponsesSourceDocumentProviderMetadata`, a discriminated union with `type` field. Supported types are `file_citation`, `container_file_citation`, `file_path`. Each includes identifiers like `fileId` and `containerId` (normalized to camelCase by SDK). Metadata follows camelCase convention unlike text part annotations which use snake_case.

Azure chat model providerMetadata type

Type-safe handling of Azure chat model metadata uses `AzureResponsesProviderMetadata` for responses models. The metadata includes `responseId`, `logprobs`, and `serviceTier`. This metadata is only returned with the default responses API, not with `azure.chat` or `azure.completion`.

Give your agent this brain