@trazum/core 2.4.0 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/pdf.d.ts +108 -0
- package/dist/pdf.d.ts.map +1 -0
- package/dist/pdf.js +323 -0
- package/dist/pdf.js.map +1 -0
- package/dist/pricing.d.ts +6 -5
- package/dist/pricing.d.ts.map +1 -1
- package/dist/pricing.js +126 -9
- package/dist/pricing.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +4 -0
- package/src/pdf.ts +356 -0
- package/src/pricing.ts +128 -9
package/src/pricing.ts
CHANGED
|
@@ -30,8 +30,13 @@ import type { ModelPricing, PricingTier, TierCondition } from './types.js';
|
|
|
30
30
|
* catalogue's headline date derived as the oldest of them rather than typed.
|
|
31
31
|
*/
|
|
32
32
|
export const PROVIDER_REVIEWED: Readonly<Record<string, string>> = Object.freeze({
|
|
33
|
-
/*
|
|
34
|
-
|
|
33
|
+
/*
|
|
34
|
+
* platform.claude.com/docs/en/about-claude/pricing, the models overview and
|
|
35
|
+
* each model's own page, read 2026-10-10. Every existing row matched; five
|
|
36
|
+
* models were added and one (Claude Haiku 5.5) deliberately was not, see the
|
|
37
|
+
* comment above its would-be place in MODELS.
|
|
38
|
+
*/
|
|
39
|
+
anthropic: '2026-10-10',
|
|
35
40
|
/*
|
|
36
41
|
* developers.openai.com/api/docs/pricing, read 2026-08-31.
|
|
37
42
|
*
|
|
@@ -96,11 +101,12 @@ export const PRICING_LAST_REVIEWED: string = Object.values(PROVIDER_REVIEWED).re
|
|
|
96
101
|
/**
|
|
97
102
|
* The defaults, which are Anthropic's numbers.
|
|
98
103
|
*
|
|
99
|
-
* Still exported and still
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
+
* Still exported, and still Anthropic's numbers for every model up to Opus 5
|
|
105
|
+
* and Sonnet 5, but no longer the whole story even there: Claude Fable 5.1 and
|
|
106
|
+
* Mythos 5.1 read the cache at 0.025x and Opus 5.5 and Sonnet 5.5 at 0.05x, so
|
|
107
|
+
* a model overrides any of these through `multipliers`, and anything computing
|
|
108
|
+
* a cost should go through `multipliersFor` rather than reading these
|
|
109
|
+
* directly. Using one cache-read ratio for every model invents a saving.
|
|
104
110
|
*/
|
|
105
111
|
export const COST_MULTIPLIERS = {
|
|
106
112
|
/** Cache write with a 5-minute TTL. */
|
|
@@ -146,6 +152,47 @@ export function multipliersFor(model: ModelPricing): {
|
|
|
146
152
|
}
|
|
147
153
|
|
|
148
154
|
export const MODELS: ModelPricing[] = [
|
|
155
|
+
{
|
|
156
|
+
/*
|
|
157
|
+
* platform.claude.com/docs/en/about-claude/pricing and the Fable 5.1 model
|
|
158
|
+
* page, read 2026-10-10. The same $10/$50 as Fable 5; what moved is the
|
|
159
|
+
* cache read, $0.25 against $10 of input, a quarter of the 0.1x every
|
|
160
|
+
* earlier Claude model pays. Writes stay at 1.25x and 2x ($12.50, $20),
|
|
161
|
+
* and the Batch API halves both sides ($5/$25).
|
|
162
|
+
*/
|
|
163
|
+
id: 'claude-fable-5-1',
|
|
164
|
+
provider: 'anthropic',
|
|
165
|
+
displayName: 'Claude Fable 5.1',
|
|
166
|
+
inputPerMTok: 10,
|
|
167
|
+
outputPerMTok: 50,
|
|
168
|
+
contextWindow: 1_000_000,
|
|
169
|
+
cacheMinTokens: 512,
|
|
170
|
+
multipliers: { cacheRead: 0.025, cacheWrite5m: 1.25, cacheWrite1h: 2, batch: 0.5 },
|
|
171
|
+
capability: 'frontier',
|
|
172
|
+
tier: 'frontier',
|
|
173
|
+
notes: 'Cache hits cost 2.5% of the input price ($0.25). Requires 30-day data retention.',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
/*
|
|
177
|
+
* The same page and prices as Fable 5.1, cache read included ($0.25,
|
|
178
|
+
* 0.025x). Sold only to verified organisations, so priced for the logs that
|
|
179
|
+
* carry it and never offered as somebody's cheaper alternative.
|
|
180
|
+
*/
|
|
181
|
+
id: 'claude-mythos-5-1',
|
|
182
|
+
provider: 'anthropic',
|
|
183
|
+
displayName: 'Claude Mythos 5.1',
|
|
184
|
+
recommendable: false,
|
|
185
|
+
inputPerMTok: 10,
|
|
186
|
+
outputPerMTok: 50,
|
|
187
|
+
contextWindow: 1_000_000,
|
|
188
|
+
cacheMinTokens: 512,
|
|
189
|
+
multipliers: { cacheRead: 0.025, cacheWrite5m: 1.25, cacheWrite1h: 2, batch: 0.5 },
|
|
190
|
+
capability: 'frontier',
|
|
191
|
+
tier: 'frontier',
|
|
192
|
+
notes:
|
|
193
|
+
'Available only to organizations verified through Anthropic\'s verification programs.'
|
|
194
|
+
+ ' Requires 30-day data retention.',
|
|
195
|
+
},
|
|
149
196
|
{
|
|
150
197
|
id: 'claude-fable-5',
|
|
151
198
|
provider: 'anthropic',
|
|
@@ -156,7 +203,7 @@ export const MODELS: ModelPricing[] = [
|
|
|
156
203
|
cacheMinTokens: 512,
|
|
157
204
|
capability: 'frontier',
|
|
158
205
|
tier: 'frontier',
|
|
159
|
-
notes: '
|
|
206
|
+
notes: 'Legacy: superseded by Claude Fable 5.1 at the same prices. Requires 30-day data retention.',
|
|
160
207
|
},
|
|
161
208
|
{
|
|
162
209
|
id: 'claude-mythos-5',
|
|
@@ -169,7 +216,28 @@ export const MODELS: ModelPricing[] = [
|
|
|
169
216
|
cacheMinTokens: 512,
|
|
170
217
|
capability: 'frontier',
|
|
171
218
|
tier: 'frontier',
|
|
172
|
-
notes:
|
|
219
|
+
notes:
|
|
220
|
+
'Available only to organizations verified through Anthropic\'s verification programs.'
|
|
221
|
+
+ ' Requires 30-day data retention.',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
/*
|
|
225
|
+
* The pricing page and the Opus 5.5 model page, read 2026-10-10. Cheaper
|
|
226
|
+
* than Opus 5 at both ends, $4/$20, and the overview now says to start
|
|
227
|
+
* there for most workloads. Cache read $0.20 is 0.05x, half the ratio of
|
|
228
|
+
* every earlier Opus; writes $5 and $8 are 1.25x and 2x; batch $2/$10.
|
|
229
|
+
*/
|
|
230
|
+
id: 'claude-opus-5-5',
|
|
231
|
+
provider: 'anthropic',
|
|
232
|
+
displayName: 'Claude Opus 5.5',
|
|
233
|
+
inputPerMTok: 4,
|
|
234
|
+
outputPerMTok: 20,
|
|
235
|
+
contextWindow: 1_000_000,
|
|
236
|
+
cacheMinTokens: 512,
|
|
237
|
+
multipliers: { cacheRead: 0.05, cacheWrite5m: 1.25, cacheWrite1h: 2, batch: 0.5 },
|
|
238
|
+
capability: 'large',
|
|
239
|
+
tier: 'opus',
|
|
240
|
+
notes: 'Cache hits cost 5% of the input price ($0.20), against 10% on Opus 5 and earlier.',
|
|
173
241
|
},
|
|
174
242
|
{
|
|
175
243
|
id: 'claude-opus-5',
|
|
@@ -216,6 +284,45 @@ export const MODELS: ModelPricing[] = [
|
|
|
216
284
|
capability: 'large',
|
|
217
285
|
tier: 'opus',
|
|
218
286
|
},
|
|
287
|
+
{
|
|
288
|
+
/*
|
|
289
|
+
* Legacy and still served, and never carried here before, so every
|
|
290
|
+
* Claude Code log from late 2025 had it as an unpriced gap. The Opus 4.5
|
|
291
|
+
* model page, read 2026-10-10: model id claude-opus-4-5-20251101, alias
|
|
292
|
+
* claude-opus-4-5, 200K context, $5/$25, 4,096-token cache minimum (the
|
|
293
|
+
* prompt caching page). Like Haiku 4.5, the short alias is the id and the
|
|
294
|
+
* dated canonical form is declared, not derived.
|
|
295
|
+
*/
|
|
296
|
+
id: 'claude-opus-4-5',
|
|
297
|
+
aliases: ['claude-opus-4-5-20251101'],
|
|
298
|
+
provider: 'anthropic',
|
|
299
|
+
displayName: 'Claude Opus 4.5',
|
|
300
|
+
inputPerMTok: 5,
|
|
301
|
+
outputPerMTok: 25,
|
|
302
|
+
contextWindow: 200_000,
|
|
303
|
+
cacheMinTokens: 4096,
|
|
304
|
+
capability: 'large',
|
|
305
|
+
tier: 'opus',
|
|
306
|
+
notes: '200K context window and a 64K output cap.',
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
/*
|
|
310
|
+
* The pricing page and the Sonnet 5.5 model page, read 2026-10-10. The
|
|
311
|
+
* same $2/$10 as Sonnet 5, with the cache read at $0.10, 0.05x, where
|
|
312
|
+
* Sonnet 5 reads at $0.20. Writes $2.50 and $4; batch $1/$5.
|
|
313
|
+
*/
|
|
314
|
+
id: 'claude-sonnet-5-5',
|
|
315
|
+
provider: 'anthropic',
|
|
316
|
+
displayName: 'Claude Sonnet 5.5',
|
|
317
|
+
inputPerMTok: 2,
|
|
318
|
+
outputPerMTok: 10,
|
|
319
|
+
contextWindow: 1_000_000,
|
|
320
|
+
cacheMinTokens: 512,
|
|
321
|
+
multipliers: { cacheRead: 0.05, cacheWrite5m: 1.25, cacheWrite1h: 2, batch: 0.5 },
|
|
322
|
+
capability: 'mid',
|
|
323
|
+
tier: 'sonnet',
|
|
324
|
+
notes: 'Cache hits cost 5% of the input price ($0.10), against 10% ($0.20) on Sonnet 5.',
|
|
325
|
+
},
|
|
219
326
|
{
|
|
220
327
|
id: 'claude-sonnet-5',
|
|
221
328
|
provider: 'anthropic',
|
|
@@ -241,6 +348,18 @@ export const MODELS: ModelPricing[] = [
|
|
|
241
348
|
capability: 'mid',
|
|
242
349
|
tier: 'sonnet',
|
|
243
350
|
},
|
|
351
|
+
/*
|
|
352
|
+
* Claude Haiku 5.5 is not here, on purpose, and its calls are an unpriced
|
|
353
|
+
* gap that names it. The pricing page (read 2026-10-10) prices it by prompt
|
|
354
|
+
* length: $0.10/$0.50 up to 100,000 tokens and $0.50/$2.50 above, where the
|
|
355
|
+
* length counts cache reads and writes and each request is priced on its
|
|
356
|
+
* own. A tier can say that, but nothing that prices a usage log passes one
|
|
357
|
+
* request's prompt length to `effectivePricing`: records are summed per
|
|
358
|
+
* workload, model and day before they are priced. Added today, every Haiku
|
|
359
|
+
* 5.5 call would fall to the undecided ceiling, five times the price most of
|
|
360
|
+
* them paid. It goes in with the change that prices tiered models per
|
|
361
|
+
* request, not before.
|
|
362
|
+
*/
|
|
244
363
|
{
|
|
245
364
|
id: 'claude-haiku-4-5',
|
|
246
365
|
// The dated form is the canonical API id and is what a real usage log
|