unstale

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

@unstale/cli on npm

@ai-sdk/cohere 417 changes

Breaking changes 3

  • The package is ESM-only; consumers using require() must switch to ESM import syntax.

    4.0.0release notes

  • The data property is tagged with a type, and the image part type is removed.

    4.0.0release notes

  • The minimum supported Node.js version is 22; supported versions are 22, 24, and 26.

    4.0.0release notes

Security 2

  • @ai-sdk/provider-utils has an Uncontrolled Resource Consumption issue

    4.0.33security advisory

  • Streamed tool call arguments are parsed more defensively against prototype keys.

    4.0.0release notes

New APIs and options 6

  • Adds max as a portable reasoning level, widening the reasoning option type; exhaustive switches and mappings must handle it.

    4.0.56release notes

  • Cohere embeddings now support selecting embedding formats.

    4.0.55release notes

  • Cohere models can now receive images.

    4.0.0release notes

  • Adds support for provider references and uploading files where supported by the provider.

    4.0.0release notes

  • Providers support a new top-level reasoning parameter.

    4.0.0release notes

  • Provider model classes can cross workflow step boundaries using serialization and deserialization methods.

    4.0.0release notes

Behavior and default changes 2

  • The Cohere embedding outputDimension option now allows 768 and 2048 for Embed 5 models.

    3.0.68, 4.0.55release notesrelease notes

  • Provider config types make headers optional, so manually constructed model configs can omit them.

    4.0.0release notes

Fixes and other changes 4

  • Top-level embedding dimensions are mapped to provider settings, allowing the requested dimensions to be passed through.

    4.0.59release notes

  • Usage details now report cached input tokens.

    4.0.56release notes

  • The User-Agent header is now standards-compliant.

    4.0.52release notes

  • Preserves complete raw usage objects returned by the Cohere provider.

    3.0.59, 4.0.33release notesrelease notes

@ai-sdk/cohere 36 changes

Breaking changes 1

  • Use embeddingModel to create an embedding model; it replaces textEmbeddingModel.

    3.0.0release notes

New APIs and options 3

Behavior and default changes 2

  • Token usage information is extended.

    3.0.0release notes

  • Requests now include the provider version in the user-agent header.

    3.0.0release notes