Skip to content

Commit 9ec139c

Browse files
zoomote[bot]taltas
andauthored
[Feat] Add Claude Opus 5.5 to model providers (#1756)
* feat(providers): add Anthropic Claude Opus 5.5 (claude-opus-5-5) * fix(bedrock): correct Opus 5.5 max output tokens and cache checkpoint minimum per AWS model card --------- Co-authored-by: @taltas <[email protected]> Co-authored-by: T <[email protected]>
1 parent 9176f2f commit 9ec139c

15 files changed

Lines changed: 284 additions & 0 deletions

‎packages/types/src/providers/anthropic.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,24 @@ export const anthropicModels = {
164164
supportsTemperature: false,
165165
description: "Claude Opus 5 is Anthropic's most capable model for complex agentic coding and enterprise work.",
166166
},
167+
"claude-opus-5-5": {
168+
maxTokens: 128_000, // Overridden to 8k if `enableReasoningEffort` is false.
169+
contextWindow: 1_000_000, // 1M context window native (no beta header required)
170+
supportsImages: true,
171+
supportsPromptCache: true,
172+
inputPrice: 4.0, // $4 per million input tokens
173+
outputPrice: 20.0, // $20 per million output tokens
174+
cacheWritesPrice: 5.0, // $5 per million tokens
175+
cacheReadsPrice: 0.2, // $0.20 per million tokens
176+
// Opus 5.5 keeps the Opus 5 adaptive-thinking / binary-toggle convention on
177+
// the direct Anthropic provider path: manual budget_tokens and non-default
178+
// sampling parameters return a 400.
179+
supportsReasoningBudget: true,
180+
supportsReasoningBinary: true,
181+
supportsTemperature: false,
182+
description:
183+
"Claude Opus 5.5 is Anthropic's most capable model for complex agentic coding and enterprise work.",
184+
},
167185
"claude-fable-5-1": {
168186
maxTokens: 128_000, // Overridden to 8k if `enableReasoningEffort` is false.
169187
contextWindow: 1_000_000,

‎packages/types/src/providers/bedrock.ts‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,28 @@ export const bedrockModels = {
252252
cachableFields: ["system", "messages", "tools"],
253253
description: "Claude Opus 5 is Anthropic's most capable model for complex agentic coding and enterprise work.",
254254
},
255+
"anthropic.claude-opus-5-5": {
256+
// 128K max output tokens per the AWS Bedrock model card:
257+
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-anthropic-claude-opus-5-5.html
258+
maxTokens: 128_000,
259+
contextWindow: 1_000_000, // 1M context window native (no beta header required)
260+
supportsImages: true,
261+
supportsPromptCache: true,
262+
supportsReasoningBudget: true,
263+
supportsReasoningBinary: true,
264+
supportsTemperature: false,
265+
inputPrice: 4.0, // $4 per million input tokens
266+
outputPrice: 20.0, // $20 per million output tokens
267+
cacheWritesPrice: 5.0, // $5 per million tokens
268+
cacheReadsPrice: 0.2, // $0.20 per million tokens
269+
// The same Bedrock model card lists 512 as the minimum tokens per cache
270+
// checkpoint for Opus 5.5 (matching the Fable 5.1 entry below).
271+
minTokensPerCachePoint: 512,
272+
maxCachePoints: 4,
273+
cachableFields: ["system", "messages", "tools"],
274+
description:
275+
"Claude Opus 5.5 is Anthropic's most capable model for complex agentic coding and enterprise work.",
276+
},
255277
"anthropic.claude-fable-5-1": {
256278
maxTokens: 128_000,
257279
contextWindow: 1_000_000,
@@ -661,6 +683,7 @@ export const BEDROCK_1M_CONTEXT_MODEL_IDS = [
661683
// - Claude Opus 4.6
662684
// - Claude Opus 4.7
663685
// - Claude Opus 5
686+
// - Claude Opus 5.5
664687
// - Claude Fable 5 and 5.1 (cross-region inference only — can only be used through an inference profile)
665688
export const BEDROCK_GLOBAL_INFERENCE_MODEL_IDS = [
666689
"anthropic.claude-sonnet-4-20250514-v1:0",
@@ -673,6 +696,7 @@ export const BEDROCK_GLOBAL_INFERENCE_MODEL_IDS = [
673696
"anthropic.claude-opus-4-7",
674697
"anthropic.claude-opus-4-8",
675698
"anthropic.claude-opus-5",
699+
"anthropic.claude-opus-5-5",
676700
"anthropic.claude-fable-5-1",
677701
"anthropic.claude-fable-5",
678702
] as const

‎packages/types/src/providers/openrouter.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export const OPEN_ROUTER_PROMPT_CACHING_MODELS = new Set([
4545
"anthropic/claude-opus-4.5",
4646
"anthropic/claude-opus-4.6",
4747
"anthropic/claude-opus-5",
48+
"anthropic/claude-opus-5-5",
4849
"anthropic/claude-fable-5.1",
4950
"anthropic/claude-fable-5",
5051
"anthropic/claude-haiku-4.5",
@@ -79,6 +80,7 @@ export const OPEN_ROUTER_REASONING_BUDGET_MODELS = new Set([
7980
"anthropic/claude-opus-4.5",
8081
"anthropic/claude-opus-4.6",
8182
"anthropic/claude-opus-5",
83+
"anthropic/claude-opus-5-5",
8284
"anthropic/claude-fable-5.1",
8385
"anthropic/claude-fable-5",
8486
"anthropic/claude-sonnet-4",

‎packages/types/src/providers/vercel-ai-gateway.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const VERCEL_AI_GATEWAY_PROMPT_CACHING_MODELS = new Set([
1414
"anthropic/claude-opus-4.5",
1515
"anthropic/claude-opus-4.6",
1616
"anthropic/claude-opus-5",
17+
"anthropic/claude-opus-5-5",
1718
"anthropic/claude-fable-5.1",
1819
"anthropic/claude-fable-5",
1920
"anthropic/claude-sonnet-4",
@@ -61,6 +62,7 @@ export const VERCEL_AI_GATEWAY_VISION_AND_TOOLS_MODELS = new Set([
6162
"anthropic/claude-opus-4.5",
6263
"anthropic/claude-opus-4.6",
6364
"anthropic/claude-opus-5",
65+
"anthropic/claude-opus-5-5",
6466
"anthropic/claude-fable-5.1",
6567
"anthropic/claude-fable-5",
6668
"anthropic/claude-sonnet-4",

‎packages/types/src/providers/vertex.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,21 @@ export const vertexModels = {
489489
supportsTemperature: false,
490490
description: "Claude Opus 5 is Anthropic's most capable model for complex agentic coding and enterprise work.",
491491
},
492+
"claude-opus-5-5": {
493+
maxTokens: 8192,
494+
contextWindow: 1_000_000, // 1M context window native (no beta header required)
495+
supportsImages: true,
496+
supportsPromptCache: true,
497+
inputPrice: 4.0, // $4 per million input tokens
498+
outputPrice: 20.0, // $20 per million output tokens
499+
cacheWritesPrice: 5.0, // $5 per million tokens
500+
cacheReadsPrice: 0.2, // $0.20 per million tokens
501+
supportsReasoningBudget: true,
502+
supportsReasoningBinary: true,
503+
supportsTemperature: false,
504+
description:
505+
"Claude Opus 5.5 is Anthropic's most capable model for complex agentic coding and enterprise work.",
506+
},
492507
"claude-fable-5-1": {
493508
maxTokens: 128_000,
494509
contextWindow: 1_000_000,

‎src/api/providers/__tests__/anthropic-vertex.spec.ts‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,25 @@ describe("VertexHandler", () => {
10441044
expect(model.info.supportsTemperature).toBe(false)
10451045
})
10461046

1047+
it("should return Claude Opus 5.5 model info", () => {
1048+
const handler = new AnthropicVertexHandler({
1049+
apiModelId: "claude-opus-5-5",
1050+
vertexProjectId: "test-project",
1051+
vertexRegion: "us-central1",
1052+
})
1053+
1054+
const model = handler.getModel()
1055+
expect(model.id).toBe("claude-opus-5-5")
1056+
expect(model.info.maxTokens).toBe(8192)
1057+
expect(model.info.contextWindow).toBe(1_000_000)
1058+
expect(model.info.inputPrice).toBe(4.0)
1059+
expect(model.info.outputPrice).toBe(20.0)
1060+
expect(model.info.supportsReasoningBinary).toBe(true)
1061+
expect(model.info.supportsReasoningBudget).toBe(true)
1062+
expect(model.info.supportsPromptCache).toBe(true)
1063+
expect(model.info.supportsTemperature).toBe(false)
1064+
})
1065+
10471066
it("should not enable 1M context when flag is disabled", () => {
10481067
const handler = new AnthropicVertexHandler({
10491068
apiModelId: VERTEX_1M_CONTEXT_MODEL_IDS[0],
@@ -1401,6 +1420,39 @@ describe("VertexHandler", () => {
14011420
expect(request.thinking).not.toHaveProperty("budget_tokens")
14021421
expect(request.temperature).toBeUndefined()
14031422
})
1423+
1424+
it("should use adaptive thinking for Claude Opus 5.5", async () => {
1425+
const opusHandler = new AnthropicVertexHandler({
1426+
apiModelId: "claude-opus-5-5",
1427+
vertexProjectId: "test-project",
1428+
vertexRegion: "us-central1",
1429+
enableReasoningEffort: true,
1430+
})
1431+
1432+
const mockCreate = vitest
1433+
.fn()
1434+
.mockImplementation(async () =>
1435+
asyncStreamFrom([
1436+
{ type: "message_start", message: { usage: { input_tokens: 10, output_tokens: 5 } } },
1437+
]),
1438+
)
1439+
// The SDK client's overloaded `create` signature can't be assigned a
1440+
// vitest mock directly, so a structural double assertion is required.
1441+
;(opusHandler["client"].messages as unknown as { create: typeof mockCreate }).create = mockCreate
1442+
1443+
await opusHandler.createMessage("You are a helpful assistant", [{ role: "user", content: "Hello" }]).next()
1444+
1445+
expect(mockCreate).toHaveBeenCalledWith(
1446+
expect.objectContaining({
1447+
thinking: { type: "adaptive" },
1448+
}),
1449+
undefined,
1450+
)
1451+
1452+
const request = mockCreate.mock.calls[0][0]
1453+
expect(request.thinking).not.toHaveProperty("budget_tokens")
1454+
expect(request.temperature).toBeUndefined()
1455+
})
14041456
})
14051457

14061458
describe("native tool calling", () => {

‎src/api/providers/__tests__/anthropic.spec.ts‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,31 @@ describe("AnthropicHandler", () => {
481481
expect(requestOptions?.headers?.["anthropic-beta"]).toContain("prompt-caching-2024-07-31")
482482
})
483483

484+
it("should use adaptive thinking for Claude Opus 5.5 when reasoning is enabled", async () => {
485+
const opusHandler = new AnthropicHandler({
486+
apiKey: "test-api-key",
487+
apiModelId: "claude-opus-5-5",
488+
enableReasoningEffort: true,
489+
modelMaxTokens: 32768,
490+
})
491+
492+
const stream = opusHandler.createMessage(systemPrompt, [
493+
{
494+
role: "user",
495+
content: [{ type: "text" as const, text: "Hello" }],
496+
},
497+
])
498+
499+
await collectStream(stream)
500+
501+
const requestBody = mockCreate.mock.calls[mockCreate.mock.calls.length - 1]?.[0]
502+
const requestOptions = mockCreate.mock.calls[mockCreate.mock.calls.length - 1]?.[1]
503+
expect(requestBody?.thinking).toEqual({ type: "adaptive" })
504+
expect(requestBody?.temperature).toBeUndefined()
505+
expect(requestBody?.max_tokens).toBe(32768)
506+
expect(requestOptions?.headers?.["anthropic-beta"]).toContain("prompt-caching-2024-07-31")
507+
})
508+
484509
it("should send the custom model ID as-is and use adaptive thinking for a custom Sonnet-5-family model", async () => {
485510
const customHandler = new AnthropicHandler({
486511
apiKey: "test-api-key",
@@ -717,6 +742,27 @@ describe("AnthropicHandler", () => {
717742
expect(model.reasoningBudget).toBeUndefined()
718743
})
719744

745+
it("should handle Claude Opus 5.5 model correctly", () => {
746+
const handler = new AnthropicHandler({
747+
apiKey: "test-api-key",
748+
apiModelId: "claude-opus-5-5",
749+
})
750+
const model = handler.getModel()
751+
expect(model.id).toBe("claude-opus-5-5")
752+
expect(model.info.maxTokens).toBe(128000)
753+
expect(model.info.contextWindow).toBe(1000000)
754+
expect(model.info.inputPrice).toBe(4.0)
755+
expect(model.info.outputPrice).toBe(20.0)
756+
expect(model.info.cacheWritesPrice).toBe(5.0)
757+
expect(model.info.cacheReadsPrice).toBe(0.2)
758+
expect(model.maxTokens).toBe(8192)
759+
expect(model.info.supportsReasoningBinary).toBe(true)
760+
expect(model.info.supportsReasoningBudget).toBe(true)
761+
expect(model.info.supportsPromptCache).toBe(true)
762+
expect(model.info.supportsTemperature).toBe(false)
763+
expect(model.reasoningBudget).toBeUndefined()
764+
})
765+
720766
it("should enable 1M context for Claude 4.5 Sonnet when beta flag is set", () => {
721767
const handler = new AnthropicHandler({
722768
apiKey: "test-api-key",

‎src/api/providers/__tests__/bedrock.spec.ts‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,41 @@ describe("AwsBedrockHandler", () => {
937937
const model = handler.getModel()
938938
expect(model.id).toBe("global.anthropic.claude-opus-5")
939939
})
940+
941+
it("should return Claude Opus 5.5 model info", () => {
942+
const handler = new AwsBedrockHandler({
943+
apiModelId: "anthropic.claude-opus-5-5",
944+
awsAccessKey: "test",
945+
awsSecretKey: "test",
946+
awsRegion: "us-east-1",
947+
})
948+
949+
const model = handler.getModel()
950+
expect(model.id).toBe("anthropic.claude-opus-5-5")
951+
expect(model.info.maxTokens).toBe(128_000)
952+
expect(model.info.contextWindow).toBe(1_000_000)
953+
expect(model.info.inputPrice).toBe(4.0)
954+
expect(model.info.outputPrice).toBe(20.0)
955+
expect(model.info.minTokensPerCachePoint).toBe(512)
956+
expect(model.info.supportsReasoningBinary).toBe(true)
957+
expect(model.info.supportsReasoningBudget).toBe(true)
958+
expect(model.info.supportsPromptCache).toBe(true)
959+
expect(model.info.supportsTemperature).toBe(false)
960+
expect(model.maxTokens).toBe(8192)
961+
})
962+
963+
it("should apply global inference prefix for Claude Opus 5.5 when awsUseGlobalInference is true", () => {
964+
const handler = new AwsBedrockHandler({
965+
apiModelId: "anthropic.claude-opus-5-5",
966+
awsAccessKey: "test",
967+
awsSecretKey: "test",
968+
awsRegion: "us-east-1",
969+
awsUseGlobalInference: true,
970+
})
971+
972+
const model = handler.getModel()
973+
expect(model.id).toBe("global.anthropic.claude-opus-5-5")
974+
})
940975
})
941976

942977
describe("1M context beta feature", () => {
@@ -1833,6 +1868,7 @@ describe("AwsBedrockHandler", () => {
18331868
expect(isAdaptiveThinkingModel("anthropic.claude-fable-5")).toBe(true)
18341869
expect(isAdaptiveThinkingModel("anthropic.claude-sonnet-5")).toBe(true)
18351870
expect(isAdaptiveThinkingModel("anthropic.claude-opus-5")).toBe(true)
1871+
expect(isAdaptiveThinkingModel("anthropic.claude-opus-5-5")).toBe(true)
18361872
// Future-proof Sonnet patterns — guarded even before a registry entry exists.
18371873
expect(isAdaptiveThinkingModel("anthropic.claude-sonnet-4-7")).toBe(true)
18381874
expect(isAdaptiveThinkingModel("anthropic.claude-sonnet-4-8")).toBe(true)
@@ -1843,6 +1879,7 @@ describe("AwsBedrockHandler", () => {
18431879
expect(isAdaptiveThinkingModel("global.anthropic.claude-fable-5")).toBe(true)
18441880
expect(isAdaptiveThinkingModel("global.anthropic.claude-sonnet-5")).toBe(true)
18451881
expect(isAdaptiveThinkingModel("global.anthropic.claude-opus-5")).toBe(true)
1882+
expect(isAdaptiveThinkingModel("global.anthropic.claude-opus-5-5")).toBe(true)
18461883
expect(isAdaptiveThinkingModel("eu.anthropic.claude-sonnet-4-7")).toBe(true)
18471884
expect(isAdaptiveThinkingModel("global.anthropic.claude-opus-4-8")).toBe(true)
18481885
})

‎src/api/providers/anthropic.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
122122
case "claude-opus-4-7":
123123
case "claude-opus-4-8":
124124
case "claude-opus-5":
125+
case "claude-opus-5-5":
125126
case "claude-fable-5-1":
126127
case "claude-fable-5":
127128
case "claude-opus-4-5-20251101":
@@ -195,6 +196,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
195196
case "claude-opus-4-7":
196197
case "claude-opus-4-8":
197198
case "claude-opus-5":
199+
case "claude-opus-5-5":
198200
case "claude-fable-5-1":
199201
case "claude-fable-5":
200202
case "claude-opus-4-5-20251101":

‎src/api/providers/fetchers/__tests__/openrouter.spec.ts‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,34 @@ describe("OpenRouter API", () => {
474474
expect(result.supportsReasoningBinary).toBe(true)
475475
})
476476

477+
it("sets claude-opus-5-5 model to Anthropic max tokens and omits temperature", () => {
478+
const mockModel = {
479+
name: "Claude Opus 5.5",
480+
description: "Test model",
481+
context_length: 1000000,
482+
max_completion_tokens: 128000,
483+
pricing: {
484+
prompt: "0.000004",
485+
completion: "0.00002",
486+
},
487+
}
488+
489+
const result = parseOpenRouterModel({
490+
id: "anthropic/claude-opus-5-5",
491+
model: mockModel,
492+
inputModality: ["text", "image"],
493+
outputModality: ["text"],
494+
maxTokens: 128000,
495+
supportedParameters: ["reasoning", "include_reasoning"],
496+
})
497+
498+
expect(result.maxTokens).toBe(128000)
499+
expect(result.contextWindow).toBe(1000000)
500+
expect(result.supportsTemperature).toBe(false)
501+
expect(result.supportsReasoningBudget).toBe(true)
502+
expect(result.supportsReasoningBinary).toBe(true)
503+
})
504+
477505
it("sets horizon-alpha model to 32k max tokens", () => {
478506
const mockModel = {
479507
name: "Horizon Alpha",

0 commit comments

Comments
 (0)