Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@ai-sdk/anthropic

vercel1.6mApache-2.01.2.12TypeScript support: included

The Anthropic provider for the AI SDK contains language model support for the Anthropic Messages API.

ai

readme

packages/ai/README.md

changelog

@ai-sdk/anthropic

1.2.12

Patch Changes

  • f64f4f0: feat (providers/anthropic): add claude v4 models

1.2.11

Patch Changes

1.2.10

Patch Changes

1.2.9

Patch Changes

  • aeba38e: Add support for URL-based PDF documents in the Anthropic provider

1.2.8

Patch Changes

1.2.7

Patch Changes

1.2.6

Patch Changes

1.2.5

Patch Changes

  • 292f543: fix (provider/google-vertex): fix anthropic support for image urls in messages

1.2.4

Patch Changes

1.2.3

Patch Changes

1.2.2

Patch Changes

  • aeaa92b: feat (provider/anthropic): expose type for validating Anthropic responses provider options

1.2.1

Patch Changes

1.2.0

Minor Changes

  • 5bc638d: AI SDK 4.2

Patch Changes

1.1.19

Patch Changes

1.1.18

Patch Changes

1.1.17

Patch Changes

1.1.16

Patch Changes

1.1.15

Patch Changes

1.1.14

Patch Changes

  • 0e8b66c: feat (provider/anthropic): support image urls

1.1.13

Patch Changes

  • 3004b14: feat(provider/anthropic): add bash_20250124 and text_editor_20250124 tools

1.1.12

Patch Changes

  • b3e5a15: fix (provider/anthropic): add model setting to allow omitting reasoning content from model requests

1.1.11

Patch Changes

  • 00276ae: feat (provider/anthropic): update types for Anthropic computer_20250124 tool
  • a4f8714: feat (provider/anthropic): update beta flag for sonnet-3-7 when using new computer-use tool

1.1.10

Patch Changes

1.1.9

Patch Changes

1.1.8

Patch Changes

1.1.7

Patch Changes

1.1.6

Patch Changes

1.1.5

Patch Changes

1.1.4

Patch Changes

1.1.3

Patch Changes

1.1.2

Patch Changes

1.1.1

Patch Changes

  • 858f934: feat (provider/anthropic): default cache-control on and mark model setting deprecated
  • b284e2c: feat (provider/google-vertex): support prompt caching for Anthropic Claude models
  • Updated dependencies [e7a9ec9]
  • Updated dependencies [0a699f1]

1.1.0

Minor Changes

  • 62ba5ad: release: AI SDK 4.1

Patch Changes

1.0.9

Patch Changes

1.0.8

Patch Changes

1.0.7

Patch Changes

1.0.6

Patch Changes

1.0.5

Patch Changes

1.0.4

Patch Changes

  • bcd892e: feat (provider/google-vertex): Add support for Anthropic models.

1.0.3

Patch Changes

1.0.2

Patch Changes

1.0.1

Patch Changes

1.0.0

Major Changes

  • 66060f7: chore (release): bump major version to 4.0
  • 0d3d3f5: chore (providers): remove baseUrl option
  • 8ad0504: chore (provider/anthropic): remove Anthropic facade
  • 2f6e8c0: chore (provider/anthropic): remove topK model setting

Patch Changes

  • Updated dependencies [b469a7e]
  • Updated dependencies [dce4158]
  • Updated dependencies [c0ddc24]
  • Updated dependencies [b1da952]
  • Updated dependencies [dce4158]
  • Updated dependencies [8426f55]
  • Updated dependencies [db46ce5]

1.0.0-canary.4

Major Changes

  • 2f6e8c0: chore (provider/anthropic): remove topK model setting

1.0.0-canary.3

Patch Changes

1.0.0-canary.2

Patch Changes

1.0.0-canary.1

Major Changes

  • 0d3d3f5: chore (providers): remove baseUrl option
  • 8ad0504: chore (provider/anthropic): remove Anthropic facade

Patch Changes

1.0.0-canary.0

Major Changes

  • 66060f7: chore (release): bump major version to 4.0

Patch Changes

0.0.56

Patch Changes

  • e6042b1: feat (provider/anthropic): add haiku 3.5 model ids

0.0.55

Patch Changes

  • ac380e3: fix (provider/anthropic): continuation mode with 3+ steps

0.0.54

Patch Changes

  • 4d2e53b: feat (provider/anthropic): pdf support
  • c8afcb5: feat (provider/anthropic): allow using computer use and cache control at the same time

0.0.53

Patch Changes

  • 3b1b69a: feat (provider/anthropic): add computer use tools
  • 3b1b69a: feat: provider-defined tools
  • 8c222cd: feat (provider/anthropic): update model ids
  • 811a317: feat (ai/core): multi-part tool results (incl. images)
  • Updated dependencies [aa98cdb]
  • Updated dependencies [1486128]
  • Updated dependencies [7b937c5]
  • Updated dependencies [3b1b69a]
  • Updated dependencies [811a317]

0.0.52

Patch Changes

0.0.51

Patch Changes

0.0.50

Patch Changes

0.0.49

Patch Changes

  • 03313cd: feat (ai): expose response id, response model, response timestamp in telemetry and api
  • 3be7c1c: fix (provider/anthropic): support prompt caching on assistant messages
  • Updated dependencies [03313cd]
  • Updated dependencies [3be7c1c]

0.0.48

Patch Changes

0.0.47

Patch Changes

0.0.46

Patch Changes

0.0.45

Patch Changes

  • 95a53a3: chore (provider/anthropic): remove tool calls beta header

0.0.44

Patch Changes

0.0.43

Patch Changes

0.0.42

Patch Changes

0.0.41

Patch Changes

0.0.40

Patch Changes

0.0.39

Patch Changes

0.0.38

Patch Changes

0.0.37

Patch Changes

0.0.36

Patch Changes

0.0.35

Patch Changes

  • fe2128f0: feat (provider/anthropic): combine sequential assistant messages into one

0.0.34

Patch Changes

  • 7d0fd5a8: fix (provider/anthropic): handle error stream chunks

0.0.33

Patch Changes

0.0.32

Patch Changes

0.0.31

Patch Changes

  • 2b9da0f0: feat (core): support stopSequences setting.
  • a5b58845: feat (core): support topK setting
  • 4aa8deb3: feat (provider): support responseFormat setting in provider api
  • 13b27ec6: chore (ai/core): remove grammar mode
  • Updated dependencies [2b9da0f0]
  • Updated dependencies [a5b58845]
  • Updated dependencies [4aa8deb3]
  • Updated dependencies [13b27ec6]

0.0.30

Patch Changes

  • 4c6b80f7: chore (provider/anthropic): improve object-tool mode

0.0.29

Patch Changes

0.0.28

Patch Changes

0.0.27

Patch Changes

  • 7e86b45e: fix (provider/anthropic): automatically trim trailing whitespace on pre-filled assistant responses

0.0.26

Patch Changes

0.0.25

Patch Changes

  • 91dc4296: chore (@ai-sdk/anthropic): remove anthropic-beta header

0.0.24

Patch Changes

  • 04800838: fix (@ai-sdk/anthropic): combine tool and user messages, combine system messages

0.0.23

Patch Changes

0.0.22

Patch Changes

  • 0a22b05b: feat (@ai-sdk/anthropic): add claude-3.5-sonnet model

0.0.21

Patch Changes

0.0.20

Patch Changes

  • 4728c37f: feat (core): add text embedding model support to provider registry
  • 7910ae84: feat (providers): support custom fetch implementations
  • Updated dependencies [7910ae84]

0.0.19

Patch Changes

0.0.18

Patch Changes

0.0.17

Patch Changes

0.0.16

Patch Changes

0.0.15

Patch Changes

0.0.14

Patch Changes

  • 06e3934: feat (provider/anthropic): streaming tool calls

0.0.13

Patch Changes

0.0.12

Patch Changes

0.0.11

Patch Changes

  • 5b01c13: feat (ai/core): add system message support in messages list

0.0.10

Patch Changes

0.0.9

Patch Changes

0.0.8

Patch Changes

0.0.7

Patch Changes

0.0.6

Patch Changes

  • eb150a6: ai/core: remove scaling of setting values (breaking change). If you were using the temperature, frequency penalty, or presence penalty settings, you need to update the providers and adjust the setting values.
  • Updated dependencies [eb150a6]

0.0.5

Patch Changes

  • c6fc35b: Add custom header support.

0.0.4

Patch Changes

  • ab60b18: Simplified model construction by directly calling provider functions. Add create... functions to create provider instances.

0.0.3

Patch Changes

  • 587240b: Standardize providers to offer .chat() method

0.0.2

Patch Changes

  • 2bff460: Fix build for release.

0.0.1

Patch Changes

  • 7b8791d: Rename baseUrl to baseURL. Automatically remove trailing slashes.
  • Updated dependencies [7b8791d]