Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/six-olives-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ai-sdk/anthropic': patch
---

feat (providers/anthropic): add claude v4 models
2 changes: 2 additions & 0 deletions content/docs/02-foundations/02-providers-and-models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ Here are the capabilities of popular models:
| [OpenAI](/providers/ai-sdk-providers/openai) | `o1` | <Check size={18} /> | <Cross size={18} /> | <Check size={18} /> | <Check size={18} /> |
| [OpenAI](/providers/ai-sdk-providers/openai) | `o1-mini` | <Check size={18} /> | <Cross size={18} /> | <Check size={18} /> | <Check size={18} /> |
| [OpenAI](/providers/ai-sdk-providers/openai) | `o1-preview` | <Cross size={18} /> | <Cross size={18} /> | <Cross size={18} /> | <Cross size={18} /> |
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-4-opus-20250514` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-4-sonnet-20250514` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-3-7-sonnet-20250219` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-3-5-sonnet-20241022` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| [Anthropic](/providers/ai-sdk-providers/anthropic) | `claude-3-5-sonnet-20240620` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
Expand Down
6 changes: 4 additions & 2 deletions content/providers/01-ai-sdk-providers/05-anthropic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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: {
Expand Down Expand Up @@ -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` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| `claude-4-sonnet-20250514` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| `claude-3-7-sonnet-20250219` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| `claude-3-5-sonnet-20241022` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
| `claude-3-5-sonnet-20240620` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> |
Expand Down
2 changes: 2 additions & 0 deletions packages/anthropic/src/anthropic-messages-settings.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Loading