@ai-sdk/anthropic 3.0.50 → 3.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -220,7 +220,7 @@ The `speed` option accepts `'fast'` or `'standard'` (default behavior).
220
220
 
221
221
  ### Reasoning
222
222
 
223
- Anthropic has reasoning support for `claude-opus-4-20250514`, `claude-sonnet-4-20250514`, and `claude-3-7-sonnet-20250219` models.
223
+ Anthropic has reasoning support for `claude-opus-4-20250514`, `claude-sonnet-4-20250514`, and `claude-sonnet-4-5-20250929` models.
224
224
 
225
225
  You can enable it using the `thinking` provider option
226
226
  and specifying a thinking budget in tokens.
@@ -258,7 +258,7 @@ import { anthropic, AnthropicLanguageModelOptions } from '@ai-sdk/anthropic';
258
258
  import { generateText } from 'ai';
259
259
 
260
260
  const result = await generateText({
261
- model: anthropic('claude-3-7-sonnet-20250219'),
261
+ model: anthropic('claude-sonnet-4-5-20250929'),
262
262
  prompt: 'Continue our conversation...',
263
263
  providerOptions: {
264
264
  anthropic: {
@@ -509,7 +509,7 @@ Cache control for tools:
509
509
 
510
510
  ```ts
511
511
  const result = await generateText({
512
- model: anthropic('claude-3-5-haiku-latest'),
512
+ model: anthropic('claude-haiku-4-5'),
513
513
  tools: {
514
514
  cityAttractions: tool({
515
515
  inputSchema: z.object({ city: z.string() }),
@@ -537,7 +537,7 @@ Here's an example:
537
537
 
538
538
  ```ts
539
539
  const result = await generateText({
540
- model: anthropic('claude-3-5-haiku-latest'),
540
+ model: anthropic('claude-haiku-4-5'),
541
541
  messages: [
542
542
  {
543
543
  role: 'user',
@@ -1302,18 +1302,16 @@ and the `mediaType` should be set to `'application/pdf'`.
1302
1302
 
1303
1303
  ### Model Capabilities
1304
1304
 
1305
- | Model | Image Input | Object Generation | Tool Usage | Computer Use | Web Search | Tool Search | Compaction |
1306
- | -------------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- |
1307
- | `claude-opus-4-6` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
1308
- | `claude-sonnet-4-6` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | |
1309
- | `claude-opus-4-5` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | |
1310
- | `claude-haiku-4-5` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | | |
1311
- | `claude-sonnet-4-5` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | |
1312
- | `claude-opus-4-1` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | | |
1313
- | `claude-opus-4-0` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | | |
1314
- | `claude-sonnet-4-0` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | | |
1315
- | `claude-3-7-sonnet-latest` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | | |
1316
- | `claude-3-5-haiku-latest` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | | |
1305
+ | Model | Image Input | Object Generation | Tool Usage | Computer Use | Web Search | Tool Search | Compaction |
1306
+ | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- |
1307
+ | `claude-opus-4-6` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
1308
+ | `claude-sonnet-4-6` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | |
1309
+ | `claude-opus-4-5` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | |
1310
+ | `claude-haiku-4-5` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | | |
1311
+ | `claude-sonnet-4-5` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | |
1312
+ | `claude-opus-4-1` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | | |
1313
+ | `claude-opus-4-0` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | | |
1314
+ | `claude-sonnet-4-0` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | | |
1317
1315
 
1318
1316
  <Note>
1319
1317
  The table above lists popular models. Please see the [Anthropic
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/anthropic",
3
- "version": "3.0.50",
3
+ "version": "3.0.51",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -2211,10 +2211,7 @@ function getModelCapabilities(modelId: string): {
2211
2211
  supportsStructuredOutput: true,
2212
2212
  isKnownModel: true,
2213
2213
  };
2214
- } else if (
2215
- modelId.includes('claude-sonnet-4-') ||
2216
- modelId.includes('claude-3-7-sonnet')
2217
- ) {
2214
+ } else if (modelId.includes('claude-sonnet-4-')) {
2218
2215
  return {
2219
2216
  maxOutputTokens: 64000,
2220
2217
  supportsStructuredOutput: false,
@@ -2226,12 +2223,6 @@ function getModelCapabilities(modelId: string): {
2226
2223
  supportsStructuredOutput: false,
2227
2224
  isKnownModel: true,
2228
2225
  };
2229
- } else if (modelId.includes('claude-3-5-haiku')) {
2230
- return {
2231
- maxOutputTokens: 8192,
2232
- supportsStructuredOutput: false,
2233
- isKnownModel: true,
2234
- };
2235
2226
  } else if (modelId.includes('claude-3-haiku')) {
2236
2227
  return {
2237
2228
  maxOutputTokens: 4096,
@@ -2,17 +2,13 @@ import { z } from 'zod/v4';
2
2
 
3
3
  // https://docs.claude.com/en/docs/about-claude/models/overview
4
4
  export type AnthropicMessagesModelId =
5
- | 'claude-3-5-haiku-20241022'
6
- | 'claude-3-5-haiku-latest'
7
- | 'claude-3-7-sonnet-20250219'
8
- | 'claude-3-7-sonnet-latest'
9
5
  | 'claude-3-haiku-20240307'
10
6
  | 'claude-haiku-4-5-20251001'
11
7
  | 'claude-haiku-4-5'
12
8
  | 'claude-opus-4-0'
9
+ | 'claude-opus-4-20250514'
13
10
  | 'claude-opus-4-1-20250805'
14
11
  | 'claude-opus-4-1'
15
- | 'claude-opus-4-20250514'
16
12
  | 'claude-opus-4-5'
17
13
  | 'claude-opus-4-5-20251101'
18
14
  | 'claude-sonnet-4-0'