Skip to content

Commit 70313cd

Browse files
authored
feat(providers): add Claude Opus 5 model (#5925)
* feat(providers): add Claude Opus 5 model * fix(providers): route Opus 5 through adaptive thinking Opus 5 supports only adaptive thinking (no extended thinking / budget_tokens), same as Opus 4.8/4.7. Add opus-5 to supportsAdaptiveThinking so thinking requests use thinking.type: adaptive instead of falling through to budget_tokens extended thinking, which Opus 4.7+ rejects with a 400. * docs(agent): regenerate agent-stream docs for Opus 5
1 parent 513292f commit 70313cd

4 files changed

Lines changed: 27 additions & 4 deletions

File tree

apps/docs/content/docs/en/workflows/blocks/agent.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Live tool-call chips stream for **Anthropic, Azure Anthropic, Google, Vertex AI,
108108
|----------|-------------------|--------|
109109
| OpenAI | Summaries only — Requires OpenAI organization verification; falls back to no summaries. | `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-5.5-pro`, `gpt-5.5`, `gpt-5.4-pro`, `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.4-nano`, `gpt-5.2-pro`, `gpt-5.2`, `gpt-5.1`, `gpt-5-pro`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `o4-mini`, `o3`, `o3-mini`, `o1` |
110110
| Anthropic | Full thinking deltas | `claude-opus-4-6`, `claude-sonnet-4-6`, `claude-opus-4-5`, `claude-opus-4-1`, `claude-sonnet-4-5`, `claude-haiku-4-5` |
111-
| Anthropic | Summaries only — These generations omit full thinking; Sim requests summarized thinking on streaming runs. | `claude-fable-5`, `claude-sonnet-5`, `claude-opus-4-8`, `claude-opus-4-7` |
111+
| Anthropic | Summaries only — These generations omit full thinking; Sim requests summarized thinking on streaming runs. | `claude-fable-5`, `claude-sonnet-5`, `claude-opus-5`, `claude-opus-4-8`, `claude-opus-4-7` |
112112
| Azure OpenAI | Summaries only — Requires OpenAI organization verification; falls back to no summaries. | `azure/gpt-5.4`, `azure/gpt-5.4-mini`, `azure/gpt-5.4-nano`, `azure/gpt-5.2`, `azure/gpt-5.1`, `azure/gpt-5.1-codex`, `azure/gpt-5`, `azure/gpt-5-mini`, `azure/gpt-5-nano`, `azure/o3`, `azure/o4-mini` |
113113
| Azure Anthropic | Full thinking deltas | `azure-anthropic/claude-opus-4-6`, `azure-anthropic/claude-opus-4-5`, `azure-anthropic/claude-sonnet-4-5`, `azure-anthropic/claude-opus-4-1`, `azure-anthropic/claude-haiku-4-5` |
114114
| Google | Summaries only | `gemini-3.6-flash`, `gemini-3.5-flash-lite`, `gemini-3.5-flash`, `gemini-3.1-pro-preview`, `gemini-3.1-flash-lite`, `gemini-3-flash-preview`, `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite` |

apps/sim/providers/anthropic/core.thinking.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ describe('buildThinkingConfig', () => {
1414
for (const model of [
1515
'claude-fable-5',
1616
'claude-sonnet-5',
17+
'claude-opus-5',
1718
'claude-opus-4-8',
1819
'claude-opus-4-7',
1920
]) {
@@ -27,6 +28,7 @@ describe('buildThinkingConfig', () => {
2728
for (const model of [
2829
'claude-fable-5',
2930
'claude-sonnet-5',
31+
'claude-opus-5',
3032
'claude-opus-4-8',
3133
'claude-opus-4-7',
3234
]) {

apps/sim/providers/anthropic/core.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const ANTHROPIC_THINKING_OUTPUT_HEADROOM = 4096
9898
* Checks if a model supports adaptive thinking (thinking.type: "adaptive").
9999
* Fable 5 supports ONLY adaptive thinking (always on; type: "disabled" is rejected).
100100
* Sonnet 5 supports ONLY adaptive thinking (manual budget_tokens returns a 400 error).
101-
* Opus 4.8 and Opus 4.7 support ONLY adaptive thinking (no extended thinking / budget_tokens).
101+
* Opus 5, Opus 4.8, and Opus 4.7 support ONLY adaptive thinking (no extended thinking / budget_tokens).
102102
* Opus 4.6 and Sonnet 4.6 support both extended and adaptive thinking — use adaptive.
103103
* Opus 4.5 supports effort but NOT adaptive thinking — it uses budget_tokens with type: "enabled".
104104
*/
@@ -107,6 +107,7 @@ function supportsAdaptiveThinking(modelId: string): boolean {
107107
return (
108108
normalizedModel.includes('fable-5') ||
109109
normalizedModel.includes('sonnet-5') ||
110+
normalizedModel.includes('opus-5') ||
110111
normalizedModel.includes('opus-4-8') ||
111112
normalizedModel.includes('opus-4.8') ||
112113
normalizedModel.includes('opus-4-7') ||
@@ -121,7 +122,7 @@ function supportsAdaptiveThinking(modelId: string): boolean {
121122
/**
122123
* Builds the thinking configuration for the Anthropic API based on model capabilities and level.
123124
*
124-
* - Fable 5, Sonnet 5, Opus 4.8, Opus 4.7: Uses adaptive thinking only (no extended thinking support)
125+
* - Fable 5, Sonnet 5, Opus 5, Opus 4.8, Opus 4.7: Uses adaptive thinking only (no extended thinking support)
125126
* - Opus 4.6, Sonnet 4.6: Uses adaptive thinking with effort parameter
126127
* - Other models: Uses budget_tokens-based extended thinking
127128
*

apps/sim/providers/models.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,27 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
797797
releaseDate: '2026-06-30',
798798
recommended: true,
799799
},
800+
{
801+
id: 'claude-opus-5',
802+
pricing: {
803+
input: 5.0,
804+
cachedInput: 0.5,
805+
output: 25.0,
806+
updatedAt: '2026-07-24',
807+
},
808+
capabilities: {
809+
nativeStructuredOutputs: true,
810+
maxOutputTokens: 128000,
811+
thinking: {
812+
levels: ['low', 'medium', 'high', 'xhigh', 'max'],
813+
default: 'high',
814+
streamed: 'summary',
815+
},
816+
},
817+
contextWindow: 1000000,
818+
releaseDate: '2026-07-24',
819+
recommended: true,
820+
},
800821
{
801822
id: 'claude-opus-4-8',
802823
pricing: {
@@ -816,7 +837,6 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
816837
},
817838
contextWindow: 1000000,
818839
releaseDate: '2026-05-28',
819-
recommended: true,
820840
},
821841
{
822842
id: 'claude-opus-4-7',

0 commit comments

Comments
 (0)