mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 18:18:43 +00:00
test(model-pricing): add cache pricing coverage for Opus 4.7
Mirrors the existing `claude-opus-4-6` cache pricing test for both `claude-opus-4-7` and `claude-opus-4-7-thinking` to explicitly validate cache creation/read rates in end-to-end cost calculation. Addresses PResto atrvd/ccs#8 issue #6 (suggestion). Built [OnSteroids](https://onsteroids.ai)
This commit is contained in:
@@ -236,6 +236,28 @@ describe('model-pricing', () => {
|
|||||||
const cost = calculateCost(usage, 'claude-opus-4-6');
|
const cost = calculateCost(usage, 'claude-opus-4-6');
|
||||||
expect(cost).toBe(36.75); // 5 + 25 + 6.25 + 0.5
|
expect(cost).toBe(36.75); // 5 + 25 + 6.25 + 0.5
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should calculate Claude Opus 4.7 cost including cache token rates', () => {
|
||||||
|
const usage: TokenUsage = {
|
||||||
|
inputTokens: 1_000_000,
|
||||||
|
outputTokens: 1_000_000,
|
||||||
|
cacheCreationTokens: 1_000_000,
|
||||||
|
cacheReadTokens: 1_000_000,
|
||||||
|
};
|
||||||
|
const cost = calculateCost(usage, 'claude-opus-4-7');
|
||||||
|
expect(cost).toBe(36.75); // 5 + 25 + 6.25 + 0.5
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should calculate Claude Opus 4.7 Thinking cost including cache token rates', () => {
|
||||||
|
const usage: TokenUsage = {
|
||||||
|
inputTokens: 1_000_000,
|
||||||
|
outputTokens: 1_000_000,
|
||||||
|
cacheCreationTokens: 1_000_000,
|
||||||
|
cacheReadTokens: 1_000_000,
|
||||||
|
};
|
||||||
|
const cost = calculateCost(usage, 'claude-opus-4-7-thinking');
|
||||||
|
expect(cost).toBe(36.75); // 5 + 25 + 6.25 + 0.5
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getKnownModels', () => {
|
describe('getKnownModels', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user