Skip to content

Commit 9473851

Browse files
committed
feat(providers): add claude-opus-4-7 model with adaptive thinking support
1 parent 6a937f1 commit 9473851

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

apps/sim/providers/anthropic/core.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,15 @@ const THINKING_BUDGET_TOKENS: Record<string, number> = {
7878

7979
/**
8080
* Checks if a model supports adaptive thinking (thinking.type: "adaptive").
81-
* Per the Anthropic API, only Opus 4.6 and Sonnet 4.6 support adaptive thinking.
81+
* Opus 4.7 supports ONLY adaptive thinking (no extended thinking / budget_tokens).
82+
* Opus 4.6 and Sonnet 4.6 support both extended and adaptive thinking — use adaptive.
8283
* Opus 4.5 supports effort but NOT adaptive thinking — it uses budget_tokens with type: "enabled".
8384
*/
8485
function supportsAdaptiveThinking(modelId: string): boolean {
8586
const normalizedModel = modelId.toLowerCase()
8687
return (
88+
normalizedModel.includes('opus-4-7') ||
89+
normalizedModel.includes('opus-4.7') ||
8790
normalizedModel.includes('opus-4-6') ||
8891
normalizedModel.includes('opus-4.6') ||
8992
normalizedModel.includes('sonnet-4-6') ||
@@ -94,6 +97,7 @@ function supportsAdaptiveThinking(modelId: string): boolean {
9497
/**
9598
* Builds the thinking configuration for the Anthropic API based on model capabilities and level.
9699
*
100+
* - Opus 4.7: Uses adaptive thinking only (no extended thinking support)
97101
* - Opus 4.6, Sonnet 4.6: Uses adaptive thinking with effort parameter
98102
* - Other models: Uses budget_tokens-based extended thinking
99103
*

apps/sim/providers/models.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,26 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
519519
toolUsageControl: true,
520520
},
521521
models: [
522+
{
523+
id: 'claude-opus-4-7',
524+
pricing: {
525+
input: 5.0,
526+
cachedInput: 0.5,
527+
output: 25.0,
528+
updatedAt: '2026-04-16',
529+
},
530+
capabilities: {
531+
temperature: { min: 0, max: 1 },
532+
nativeStructuredOutputs: true,
533+
maxOutputTokens: 128000,
534+
thinking: {
535+
levels: ['low', 'medium', 'high', 'max'],
536+
default: 'high',
537+
},
538+
},
539+
contextWindow: 1000000,
540+
releaseDate: '2026-04-16',
541+
},
522542
{
523543
id: 'claude-opus-4-6',
524544
pricing: {

0 commit comments

Comments
 (0)