Skip to content

Commit f308054

Browse files
committed
feat(providers): add Claude Sonnet 5 model
- Add claude-sonnet-5 (1M context, 128k output, adaptive thinking with low/medium/high/xhigh/max effort) as the new flagship Anthropic Sonnet - Use introductory pricing ($2/$10 per MTok, $0.20 cached) in effect through Aug 31 2026 - Promote to recommended and set as Anthropic defaultModel; demote claude-sonnet-4-6 - Route claude-sonnet-5 through adaptive thinking in anthropic/core.ts (manual budget_tokens returns a 400)
1 parent 4298e57 commit f308054

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

apps/sim/providers/anthropic/core.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,15 @@ const THINKING_BUDGET_TOKENS: Record<string, number> = {
8484

8585
/**
8686
* Checks if a model supports adaptive thinking (thinking.type: "adaptive").
87+
* Sonnet 5 supports ONLY adaptive thinking (manual budget_tokens returns a 400 error).
8788
* Opus 4.8 and Opus 4.7 support ONLY adaptive thinking (no extended thinking / budget_tokens).
8889
* Opus 4.6 and Sonnet 4.6 support both extended and adaptive thinking — use adaptive.
8990
* Opus 4.5 supports effort but NOT adaptive thinking — it uses budget_tokens with type: "enabled".
9091
*/
9192
function supportsAdaptiveThinking(modelId: string): boolean {
9293
const normalizedModel = modelId.toLowerCase()
9394
return (
95+
normalizedModel.includes('sonnet-5') ||
9496
normalizedModel.includes('opus-4-8') ||
9597
normalizedModel.includes('opus-4.8') ||
9698
normalizedModel.includes('opus-4-7') ||
@@ -105,7 +107,7 @@ function supportsAdaptiveThinking(modelId: string): boolean {
105107
/**
106108
* Builds the thinking configuration for the Anthropic API based on model capabilities and level.
107109
*
108-
* - Opus 4.8, Opus 4.7: Uses adaptive thinking only (no extended thinking support)
110+
* - Sonnet 5, Opus 4.8, Opus 4.7: Uses adaptive thinking only (no extended thinking support)
109111
* - Opus 4.6, Sonnet 4.6: Uses adaptive thinking with effort parameter
110112
* - Other models: Uses budget_tokens-based extended thinking
111113
*

apps/sim/providers/models.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,14 +661,34 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
661661
fileAttachment: { maxBytes: 50 * 1024 * 1024, strategy: 'remote-url' },
662662
name: 'Anthropic',
663663
description: "Anthropic's Claude models",
664-
defaultModel: 'claude-sonnet-4-6',
664+
defaultModel: 'claude-sonnet-5',
665665
modelPatterns: [/^claude/],
666666
icon: AnthropicIcon,
667667
color: '#D97757',
668668
capabilities: {
669669
toolUsageControl: true,
670670
},
671671
models: [
672+
{
673+
id: 'claude-sonnet-5',
674+
pricing: {
675+
input: 2.0,
676+
cachedInput: 0.2,
677+
output: 10.0,
678+
updatedAt: '2026-06-30',
679+
},
680+
capabilities: {
681+
nativeStructuredOutputs: true,
682+
maxOutputTokens: 128000,
683+
thinking: {
684+
levels: ['low', 'medium', 'high', 'xhigh', 'max'],
685+
default: 'high',
686+
},
687+
},
688+
contextWindow: 1000000,
689+
releaseDate: '2026-06-30',
690+
recommended: true,
691+
},
672692
{
673693
id: 'claude-opus-4-8',
674694
pricing: {
@@ -747,7 +767,6 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
747767
},
748768
contextWindow: 1000000,
749769
releaseDate: '2026-02-17',
750-
recommended: true,
751770
},
752771
{
753772
id: 'claude-opus-4-5',

0 commit comments

Comments
 (0)