npm / @ai-sdk/cohere
@ai-sdk/cohere
What changed in @ai-sdk/cohere 3 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.
4 breaking2 security9 new APIs and options4 behavior and defaults4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@ai-sdk/cohere 417 changes
Breaking changes 3
The package is ESM-only; consumers using require() must switch to ESM import syntax.
The data property is tagged with a type, and the image part type is removed.
The minimum supported Node.js version is 22; supported versions are 22, 24, and 26.
Security 2
@ai-sdk/provider-utils has an Uncontrolled Resource Consumption issue
Streamed tool call arguments are parsed more defensively against prototype keys.
New APIs and options 6
Adds max as a portable reasoning level, widening the reasoning option type; exhaustive switches and mappings must handle it.
Cohere embeddings now support selecting embedding formats.
Cohere models can now receive images.
Adds support for provider references and uploading files where supported by the provider.
Providers support a new top-level reasoning parameter.
Provider model classes can cross workflow step boundaries using serialization and deserialization methods.
Behavior and default changes 2
The Cohere embedding outputDimension option now allows 768 and 2048 for Embed 5 models.
Provider config types make headers optional, so manually constructed model configs can omit them.
Fixes and other changes 4
Top-level embedding dimensions are mapped to provider settings, allowing the requested dimensions to be passed through.
Usage details now report cached input tokens.
The User-Agent header is now standards-compliant.
Preserves complete raw usage objects returned by the Cohere provider.
@ai-sdk/cohere 36 changes
Breaking changes 1
Use embeddingModel to create an embedding model; it replaces textEmbeddingModel.
New APIs and options 3
The raw finish reason is now exposed.
Reranking is now supported.
Reranking models now support shorthand names.
Behavior and default changes 2
Token usage information is extended.
Requests now include the provider version in the user-agent header.