diff --git a/.changeset/six-olives-rest.md b/.changeset/six-olives-rest.md new file mode 100644 index 000000000000..4105dbab3be5 --- /dev/null +++ b/.changeset/six-olives-rest.md @@ -0,0 +1,5 @@ +--- +'@ai-sdk/anthropic': patch +--- + +feat (providers/anthropic): add claude v4 models diff --git a/content/docs/02-foundations/02-providers-and-models.mdx b/content/docs/02-foundations/02-providers-and-models.mdx index 2b9ac78bf0be..a87bee6fe6d0 100644 --- a/content/docs/02-foundations/02-providers-and-models.mdx +++ b/content/docs/02-foundations/02-providers-and-models.mdx @@ -113,6 +113,8 @@ Here are the capabilities of popular models: | [OpenAI](/providers/ai-sdk-providers/openai) | `o1` | | | | | | [OpenAI](/providers/ai-sdk-providers/openai) | `o1-mini` | | | | | | [OpenAI](/providers/ai-sdk-providers/openai) | `o1-preview` | | | | | +| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-4-opus-20250514` | | | | | +| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-4-sonnet-20250514` | | | | | | [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-3-7-sonnet-20250219` | | | | | | [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-3-5-sonnet-20241022` | | | | | | [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-3-5-sonnet-20240620` | | | | | diff --git a/content/providers/01-ai-sdk-providers/05-anthropic.mdx b/content/providers/01-ai-sdk-providers/05-anthropic.mdx index 82f95360c7cc..64cc4bce8d35 100644 --- a/content/providers/01-ai-sdk-providers/05-anthropic.mdx +++ b/content/providers/01-ai-sdk-providers/05-anthropic.mdx @@ -106,7 +106,7 @@ The following optional settings are available for Anthropic models: ### Reasoning -Anthropic has reasoning support for the `claude-3-7-sonnet-20250219` model. +Anthropic has reasoning support for `claude-4-opus-20250514`, `claude-4-sonnet-20250514`, and `claude-3-7-sonnet-20250219` models. You can enable it using the `thinking` provider option and specifying a thinking budget in tokens. @@ -116,7 +116,7 @@ import { anthropic, AnthropicProviderOptions } from '@ai-sdk/anthropic'; import { generateText } from 'ai'; const { text, reasoning, reasoningDetails } = await generateText({ - model: anthropic('claude-3-7-sonnet-20250219'), + model: anthropic('claude-4-opus-20250514'), prompt: 'How many people will live in the world in 2040?', providerOptions: { anthropic: { @@ -411,6 +411,8 @@ and the `mimeType` should be set to `'application/pdf'`. | Model | Image Input | Object Generation | Tool Usage | Computer Use | | ---------------------------- | ------------------- | ------------------- | ------------------- | ------------------- | +| `claude-4-opus-20250514` | | | | | +| `claude-4-sonnet-20250514` | | | | | | `claude-3-7-sonnet-20250219` | | | | | | `claude-3-5-sonnet-20241022` | | | | | | `claude-3-5-sonnet-20240620` | | | | | diff --git a/packages/anthropic/src/anthropic-messages-settings.ts b/packages/anthropic/src/anthropic-messages-settings.ts index 4d78dacfdc9f..c080739d0ead 100644 --- a/packages/anthropic/src/anthropic-messages-settings.ts +++ b/packages/anthropic/src/anthropic-messages-settings.ts @@ -1,5 +1,7 @@ // https://docs.anthropic.com/claude/docs/models-overview export type AnthropicMessagesModelId = + | 'claude-4-opus-20250514' + | 'claude-4-sonnet-20250514' | 'claude-3-7-sonnet-20250219' | 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022'