npm / @ai-sdk/mistral
@ai-sdk/mistral
What changed in @ai-sdk/mistral 2 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
37 breaking1 security10 deprecations29 new APIs and options1 performance10 behavior and defaults20 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@ai-sdk/mistral 745 changes
Breaking changes 27
OpenTelemetry span collection is no longer built into the ai package. Install this package and register an OpenTelemetry instance globally to receive traces.
The deprecated top-level LanguageModelUsage field is removed; use inputTokenDetails.cacheReadTokens instead.
Top-level content, tool results and calls, files, sources, and warnings on generateText and streamText results now accumulate across every step; use finalStep for final-step-only values.
Tool callbacks use the stable context option instead of experimental_context; declare tool-specific fields with contextSchema and supply them through toolsContext.
The deprecated option was removed; replace remaining usages with activeTools.
Move streamText's deprecated top-level includeRawChunks option into include.rawChunks.
generateText and streamText no longer include request bodies in step results by default; set include.requestBody to true when those bodies are needed.
generateText no longer includes response bodies by default; set include.responseBody to true when those bodies are needed.
The deprecated function was removed; use isToolUIPart instead.
The deprecated tool-result content part type was removed; use the file variant with tagged data for inline file content.
The minimum supported Node.js version is 22; supported versions are 22, 24, and 26.
streamText now invokes onChunk for every TextStreamPart, including lifecycle, boundary, and terminal parts; handlers should guard the chunk types they process.
Telemetry integrations and tracing-channel subscribers receive onEmbedEnd instead of onEmbedFinish.
The per-call callback for completed embed and embedMany operations is renamed from experimental_onFinish to onEnd.
The per-call callback for completed rerank operations is renamed from experimental_onFinish to onEnd.
The onEnd callback follows the updated result shape: usage and content-related values cover all steps, while final-step-only values are available on finalStep.
Telemetry integrations and tracing-channel subscribers receive onRerankEnd instead of onRerankFinish.
The per-step lifecycle callback is renamed from onStepFinish to onStepEnd across generation, streaming, agents, and UI message stream helpers. Telemetry integrations should implement onStepEnd.
The deprecated top-level LanguageModelUsage field is removed; use outputTokenDetails.reasoningTokens instead.
AI SDK packages are ESM-only, so CommonJS require() is no longer supported; use ESM import syntax.
Shared generation or agent runtime data moves to runtimeContext, separate from per-tool context supplied through toolsContext.
Each StepResult now contains only response messages produced by that step, rather than accumulated messages from prior steps. Use result.responseMessages for the full history.
Approval logic can be configured on a generation call or agent, including per-tool or callback-based policies.
The deprecated type was removed; replace imports and type references with ToolExecutionOptions.
Supply tool-specific context through toolsContext, keyed by tool name; when any tool declares contextSchema, toolsContext becomes required and includes only contextual tools.
The tracer property is removed from experimental_telemetry; pass a custom OpenTelemetry Tracer to the OpenTelemetry constructor instead.
generateText and streamText usage now totals tokens across all steps; use finalStep.usage for the previous final-step-only value.
Deprecations 10
Tool-result file content uses one canonical variant with a tagged data union and required mediaType; legacy variants are runtime auto-migrated.
The user-message image content part is deprecated; use a file part with an image mediaType instead.
The tool-level needsApproval property is deprecated; move approval logic to toolApproval on the call or agent so policy can vary by request.
The final lifecycle callback for text generation, streaming, and agents is renamed from onFinish to onEnd. onFinish remains a deprecated alias, and onEnd takes precedence when both are provided.
The generateText and streamText tool execution completion callback is renamed from experimental_onToolCallFinish; the old name remains a deprecated fallback.
The generateText and streamText tool execution start callback is renamed from experimental_onToolCallStart; the old name remains a deprecated fallback.
Top-level reasoning, reasoningText, request, response, and providerMetadata result properties are deprecated; read final-step values from finalStep.
The full event stream returned by streamText is renamed from fullStream to stream. fullStream remains a deprecated alias.
totalUsage is deprecated; use usage for token usage across all steps.
The streamText result helper is deprecated; use the stateless top-level helper to transform any stream.
New APIs and options 4
Declare each tool's context fields with contextSchema so tool context is inferred and limited to fields declared for that tool.
Use finalStep to read final-step-only result values, including reasoning, request, response, provider metadata, and the previous per-step result properties.
Reasoning-trace files now have a distinct content-part type; exhaustive handlers and validators should support it.
Register the OpenTelemetry integration globally at application startup to collect traces.
Behavior and default changes 4
The stable include option replaces experimental_include for generateText, streamText, and ToolLoopAgent. The old name remains a deprecated alias, and include takes precedence.
When migrating to the top-level reasoning option, remove overlapping providerOptions settings because provider-specific settings take precedence.
Once a telemetry integration is registered, AI SDK calls emit telemetry events by default; set isEnabled to false on a call to opt out, or do not register integrations to disable telemetry globally.
The telemetry option replaces experimental_telemetry. The old name remains a deprecated alias during the deprecation window.
@ai-sdk/mistral 63 changes
Breaking changes 2
Provider method textEmbedding has been renamed to embedding; update provider calls to use the new method.
Provider method textEmbeddingModel has been renamed to embeddingModel; update provider calls to use the new method.
Fixes and other changes 1
Update the package to the latest @ai-sdk/* version when upgrading to AI SDK 6.
@ai-sdk/mistral 448 changes
Breaking changes 6
The experimental OpenAI Live method can now resolve asynchronously; await its result before using the connection settings.
Affected provider, parsing, and transport error paths that previously reported other now report error.
The package is ESM-only; consumers using require() must switch to ESM import syntax.
File part data is now tagged with a type, and the image part type is removed.
image-* tool output types are rolled into their equivalent file-* types.
The Mistral facade has been removed; use the mistral object or createMistral function instead.
Security 1
@ai-sdk/provider-utils has an Uncontrolled Resource Consumption issue
New APIs and options 16
Adds Voxtral realtime transcription support with streaming audio, context bias, speaker diarization, speaker references, and raw turn-detection events.
Adds realtime voice agent support.
Low and max reasoning effort are now supported for GLM-5.3 models.
Adds Voxtral 3 offline transcription and speech model IDs.
Exposes speech expressiveness and pronunciation hints.
Adds support for transcription context phrases and detected language.
Adds a conversations API to @ai-sdk/mistral.
Adds a web search tool to @ai-sdk/mistral.
The portable reasoning levels now include max, widening LanguageModelV4CallOptions['reasoning'] and ReasoningLevel. Consumers with exhaustive switches or mappings must handle it.
Experimental streaming lifecycle callbacks were added for speech generation and transcription.
File uploading is supported where supported by the provider.
Support was added for the mistral-medium-3.5 model.
Provider references are supported, allowing developers to use provider references with the provider.
Reasoning configuration is supported for mistral-small-latest.
Provider model classes include WORKFLOW_DESERIALIZE to enable models to cross workflow step boundaries without serialization errors.
Provider model classes include WORKFLOW_SERIALIZE to enable models to cross workflow step boundaries without serialization errors.
Performance 1
Construction is deferred until first use to reduce package import time.
Behavior and default changes 6
Known model ID autocomplete suggestions are derived from provider model catalog declarations, so catalog updates flow into autocomplete while preserving existing suggestions, endpoint-specific lists, and custom model IDs.
Remains an optional peer dependency needed only for browser voice connections, so server-side consumers do not install it automatically.
These settings now support promises and synchronous or asynchronous callbacks, resolving credentials per authenticated request while preserving existing authentication behavior and synchronous credential serialization.
Top-level embedding dimensions are mapped to provider settings.
Telemetry was added to speech generation and transcription, with provider usage propagation.
headers is optional in provider config types, so manually constructed model configs can omit it.
Fixes and other changes 18
For Mistral Large 4 Chat models, disabled reasoning maps to low; medium reasoning is preserved and accepted through provider options.
Mistral Chat Completions now sends the native function choice and preserves all tool definitions in the request.
Tool calls now preserve string arguments and safely serialize BigInt and circular structures in tool calls and outputs.
Mistral Chat streams that end cleanly without a provider completion signal now report interrupted, preserve partial output, and do not emit an error solely for the interruption.
Updates timestamp validation for Voxtral 3.
Reasoning configuration is forwarded for unknown model IDs instead of being silently stripped; known models without reasoning-effort support retain their previous handling.
Reasoning effort is now enabled for Mistral Large 4 models.
JSON schemas are preserved when structured outputs are disabled.
Provider error finish reasons are mapped to error.
The User-Agent header is now standards-compliant.
Fixes streamed tool calls with missing, blank, or repeated IDs.
Updated Mistral model IDs.
Updated the Mistral reasoning configuration.
Raw usage metadata now preserves complete Mistral chat usage objects.
Mistral now supports incremental streaming tool calls.
Cached token counts from Mistral API usage responses are now mapped instead of reporting all prompt tokens as noCacheTokens.
stopSequences is now forwarded as Mistral's native stop parameter.
Tool result output content file part types now align with top-level message file part types.
@ai-sdk/mistral 35 changes
New APIs and options 5
The Mistral provider adds support for pronunciation hints.
The Mistral provider adds support for speech expressiveness.
The Mistral provider adds Voxtral 3 speech model IDs.
Use embeddingModel instead of textEmbeddingModel; textEmbeddingModel and textEmbedding remain as deprecated aliases.
An option was added to disable parallel tool calls in Mistral.
@ai-sdk/mistral 27 changes
Breaking changes 2
Mistral provider configuration was converted to providerOptions, changing how developers supply provider-specific options.
The embedding-model-v2 field rawResponse was renamed to response.
New APIs and options 4
Magistral reasoning models were added.
Mistral Medium 3 model support was added.
Raw chunk support was added.
The embedding-model-v2 interface adds a response body field.
Fixes and other changes 1
Zod compatibility was improved.