|
| 1 | +import type { ModelInfo } from "../model.js" |
| 2 | + |
| 3 | +// https://docs.anthropic.com/en/docs/about-claude/models |
| 4 | + |
| 5 | +export type AnthropicModelId = keyof typeof anthropicModels |
| 6 | +export const anthropicDefaultModelId: AnthropicModelId = "claude-sonnet-4-20250514" |
| 7 | + |
| 8 | +export const anthropicModels = { |
| 9 | + "claude-sonnet-4-20250514": { |
| 10 | + maxTokens: 64_000, // Overridden to 8k if `enableReasoningEffort` is false. |
| 11 | + contextWindow: 200_000, |
| 12 | + supportsImages: true, |
| 13 | + supportsComputerUse: true, |
| 14 | + supportsPromptCache: true, |
| 15 | + inputPrice: 3.0, // $3 per million input tokens |
| 16 | + outputPrice: 15.0, // $15 per million output tokens |
| 17 | + cacheWritesPrice: 3.75, // $3.75 per million tokens |
| 18 | + cacheReadsPrice: 0.3, // $0.30 per million tokens |
| 19 | + supportsReasoningBudget: true, |
| 20 | + }, |
| 21 | + "claude-opus-4-20250514": { |
| 22 | + maxTokens: 32_000, // Overridden to 8k if `enableReasoningEffort` is false. |
| 23 | + contextWindow: 200_000, |
| 24 | + supportsImages: true, |
| 25 | + supportsComputerUse: true, |
| 26 | + supportsPromptCache: true, |
| 27 | + inputPrice: 15.0, // $15 per million input tokens |
| 28 | + outputPrice: 75.0, // $75 per million output tokens |
| 29 | + cacheWritesPrice: 18.75, // $18.75 per million tokens |
| 30 | + cacheReadsPrice: 1.5, // $1.50 per million tokens |
| 31 | + supportsReasoningBudget: true, |
| 32 | + }, |
| 33 | + "claude-3-7-sonnet-20250219:thinking": { |
| 34 | + maxTokens: 128_000, // Unlocked by passing `beta` flag to the model. Otherwise, it's 64k. |
| 35 | + contextWindow: 200_000, |
| 36 | + supportsImages: true, |
| 37 | + supportsComputerUse: true, |
| 38 | + supportsPromptCache: true, |
| 39 | + inputPrice: 3.0, // $3 per million input tokens |
| 40 | + outputPrice: 15.0, // $15 per million output tokens |
| 41 | + cacheWritesPrice: 3.75, // $3.75 per million tokens |
| 42 | + cacheReadsPrice: 0.3, // $0.30 per million tokens |
| 43 | + supportsReasoningBudget: true, |
| 44 | + requiredReasoningBudget: true, |
| 45 | + }, |
| 46 | + "claude-3-7-sonnet-20250219": { |
| 47 | + maxTokens: 8192, // Since we already have a `:thinking` virtual model we aren't setting `supportsReasoningBudget: true` here. |
| 48 | + contextWindow: 200_000, |
| 49 | + supportsImages: true, |
| 50 | + supportsComputerUse: true, |
| 51 | + supportsPromptCache: true, |
| 52 | + inputPrice: 3.0, // $3 per million input tokens |
| 53 | + outputPrice: 15.0, // $15 per million output tokens |
| 54 | + cacheWritesPrice: 3.75, // $3.75 per million tokens |
| 55 | + cacheReadsPrice: 0.3, // $0.30 per million tokens |
| 56 | + }, |
| 57 | + "claude-3-5-sonnet-20241022": { |
| 58 | + maxTokens: 8192, |
| 59 | + contextWindow: 200_000, |
| 60 | + supportsImages: true, |
| 61 | + supportsComputerUse: true, |
| 62 | + supportsPromptCache: true, |
| 63 | + inputPrice: 3.0, // $3 per million input tokens |
| 64 | + outputPrice: 15.0, // $15 per million output tokens |
| 65 | + cacheWritesPrice: 3.75, // $3.75 per million tokens |
| 66 | + cacheReadsPrice: 0.3, // $0.30 per million tokens |
| 67 | + }, |
| 68 | + "claude-3-5-haiku-20241022": { |
| 69 | + maxTokens: 8192, |
| 70 | + contextWindow: 200_000, |
| 71 | + supportsImages: false, |
| 72 | + supportsPromptCache: true, |
| 73 | + inputPrice: 1.0, |
| 74 | + outputPrice: 5.0, |
| 75 | + cacheWritesPrice: 1.25, |
| 76 | + cacheReadsPrice: 0.1, |
| 77 | + }, |
| 78 | + "claude-3-opus-20240229": { |
| 79 | + maxTokens: 4096, |
| 80 | + contextWindow: 200_000, |
| 81 | + supportsImages: true, |
| 82 | + supportsPromptCache: true, |
| 83 | + inputPrice: 15.0, |
| 84 | + outputPrice: 75.0, |
| 85 | + cacheWritesPrice: 18.75, |
| 86 | + cacheReadsPrice: 1.5, |
| 87 | + }, |
| 88 | + "claude-3-haiku-20240307": { |
| 89 | + maxTokens: 4096, |
| 90 | + contextWindow: 200_000, |
| 91 | + supportsImages: true, |
| 92 | + supportsPromptCache: true, |
| 93 | + inputPrice: 0.25, |
| 94 | + outputPrice: 1.25, |
| 95 | + cacheWritesPrice: 0.3, |
| 96 | + cacheReadsPrice: 0.03, |
| 97 | + }, |
| 98 | +} as const satisfies Record<string, ModelInfo> |
| 99 | + |
| 100 | +export const ANTHROPIC_DEFAULT_MAX_TOKENS = 8192 |
0 commit comments