Skip to content

Commit bb04dc0

Browse files
author
Donuts AI Agent
committed
feat: add Claude Opus 4.6 model support
- Add Claude Opus 4.6 to MODEL_REGISTRY - Model ID: anthropic.claude-opus-4-6-v1 (per official AWS/Anthropic docs) - Inference profiles: Global and US regional cross-region inference - Max output tokens: 128000 - Pricing: $5/1M input, $25/1M output tokens - Supports thinking mode and prompt caching Closes #292
1 parent 84e6ad5 commit bb04dc0

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

src/common/models/models.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,41 @@ const MODEL_REGISTRY: ModelConfig[] = [
667667
}
668668
},
669669

670+
// Claude Opus 4.6
671+
{
672+
baseId: 'claude-opus-4-6-v1',
673+
name: 'Claude Opus 4.6',
674+
provider: 'anthropic',
675+
category: 'text',
676+
toolUse: true,
677+
maxTokensLimit: 128000,
678+
supportsThinking: true,
679+
inferenceProfiles: [
680+
{
681+
type: 'global',
682+
prefix: 'global',
683+
regions: ['us-west-2', 'us-east-1', 'us-east-2', 'eu-west-1', 'ap-northeast-1'],
684+
displaySuffix: '(Global)'
685+
},
686+
{
687+
type: 'regional-us',
688+
prefix: 'us',
689+
regions: ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2'],
690+
displaySuffix: '(US)'
691+
}
692+
],
693+
pricing: {
694+
input: 0.005,
695+
output: 0.025,
696+
cacheRead: 0.0005,
697+
cacheWrite: 0.00625
698+
},
699+
cache: {
700+
supported: true,
701+
cacheableFields: ['messages', 'system', 'tools']
702+
}
703+
},
704+
670705
// Amazon Nova Premier
671706
{
672707
baseId: 'nova-premier-v1:0',

src/renderer/src/lib/pricing/modelPricing.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,32 @@ test('should calculate cost for Claude Opus 4.1', () => {
7979
expect(actualCost).toBeCloseTo(expectedCost, 6)
8080
})
8181

82+
test('should calculate cost for Claude Opus 4.6', () => {
83+
const modelId = 'anthropic.claude-opus-4-6-v1'
84+
const pricingCalculator = new PricingCalculator(modelId)
85+
86+
const inputTokens = 1000
87+
const outputTokens = 500
88+
const cacheReadTokens = 200
89+
const cacheWriteTokens = 100
90+
91+
const expectedCost =
92+
(inputTokens * 0.005 +
93+
outputTokens * 0.025 +
94+
cacheReadTokens * 0.0005 +
95+
cacheWriteTokens * 0.00625) /
96+
1000
97+
98+
const actualCost = pricingCalculator.calculateTotalCost(
99+
inputTokens,
100+
outputTokens,
101+
cacheReadTokens,
102+
cacheWriteTokens
103+
)
104+
105+
expect(actualCost).toBeCloseTo(expectedCost, 6)
106+
})
107+
82108
test('should return 0 for unknown model', () => {
83109
const modelId = 'unknown-model'
84110
const pricingCalculator = new PricingCalculator(modelId)

0 commit comments

Comments
 (0)