@askalf/dario 5.5.36 → 5.5.38
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/analytics.d.ts +23 -0
- package/dist/analytics.js +27 -10
- package/package.json +1 -1
package/dist/analytics.d.ts
CHANGED
|
@@ -113,6 +113,29 @@ interface Rate {
|
|
|
113
113
|
cacheRead: number;
|
|
114
114
|
cacheCreate: number;
|
|
115
115
|
}
|
|
116
|
+
interface PricingEntry extends Rate {
|
|
117
|
+
/**
|
|
118
|
+
* Optional promotional pricing in effect through `until` (inclusive, UTC
|
|
119
|
+
* end-of-day), after which the standard rate above applies. Date-modeled so
|
|
120
|
+
* historical cost estimates stay accurate on BOTH sides of the cutover
|
|
121
|
+
* instead of always showing one rate — each request is priced at the rate
|
|
122
|
+
* effective at its own timestamp.
|
|
123
|
+
*/
|
|
124
|
+
intro?: Rate & {
|
|
125
|
+
until: string;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Published per-1M-token rates, keyed by dario's model id.
|
|
130
|
+
*
|
|
131
|
+
* EXPORTED so scripts/check-pricing-drift.mjs can diff it against Anthropic's
|
|
132
|
+
* published table. These are external facts with no natural expiry: an entry
|
|
133
|
+
* that is correct today goes wrong the moment Anthropic changes it, and
|
|
134
|
+
* nothing in this repo would notice. That has happened twice — Sonnet 5's
|
|
135
|
+
* cancelled cutover (#1047) and Haiku 4.5 carrying Haiku 3.5's rates — which
|
|
136
|
+
* is why the watcher exists (#1048).
|
|
137
|
+
*/
|
|
138
|
+
export declare const PRICING: Record<string, PricingEntry>;
|
|
116
139
|
/**
|
|
117
140
|
* The per-1M-token rate for `model` in effect at `atMs` (epoch ms): the intro
|
|
118
141
|
* rate while within its window, otherwise the standard rate. A trailing context
|
package/dist/analytics.js
CHANGED
|
@@ -113,7 +113,17 @@ export function isNonSubscriptionBilling(claim) {
|
|
|
113
113
|
return false;
|
|
114
114
|
return !SUBSCRIPTION_CLAIMS.has(claim);
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Published per-1M-token rates, keyed by dario's model id.
|
|
118
|
+
*
|
|
119
|
+
* EXPORTED so scripts/check-pricing-drift.mjs can diff it against Anthropic's
|
|
120
|
+
* published table. These are external facts with no natural expiry: an entry
|
|
121
|
+
* that is correct today goes wrong the moment Anthropic changes it, and
|
|
122
|
+
* nothing in this repo would notice. That has happened twice — Sonnet 5's
|
|
123
|
+
* cancelled cutover (#1047) and Haiku 4.5 carrying Haiku 3.5's rates — which
|
|
124
|
+
* is why the watcher exists (#1048).
|
|
125
|
+
*/
|
|
126
|
+
export const PRICING = {
|
|
117
127
|
// Fable 5 — official pricing (published with the 2026-07-01 redeploy):
|
|
118
128
|
// $10/$50 per 1M in/out, 5m cache-write $12.50, cache-read $1 (platform docs).
|
|
119
129
|
// Was previously assumed at the opus-4-8 rate ($5/$25) — corrected here.
|
|
@@ -126,15 +136,21 @@ const PRICING = {
|
|
|
126
136
|
'claude-opus-4-7': { input: 5, output: 25, cacheRead: 0.5, cacheCreate: 6.25 },
|
|
127
137
|
// Opus 4.6 is $5/$25 (same as 4.7/4.8), not the old $15/$75 Opus-4.1 rate.
|
|
128
138
|
'claude-opus-4-6': { input: 5, output: 25, cacheRead: 0.5, cacheCreate: 6.25 },
|
|
129
|
-
// Sonnet 5
|
|
130
|
-
//
|
|
131
|
-
//
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
139
|
+
// Sonnet 5 is $2/$10 — PERMANENTLY. This shipped as "introductory pricing
|
|
140
|
+
// through 2026-08-31, then $3/$15", and was modeled here as a dated cutover.
|
|
141
|
+
// Anthropic has since cancelled that increase and made $2/$10 the standard
|
|
142
|
+
// price, so the cutover must NOT stay: on 2026-09-01 it would have silently
|
|
143
|
+
// started pricing every Sonnet 5 record 50% high, with no error and nothing
|
|
144
|
+
// in the output to suggest the number had moved.
|
|
145
|
+
//
|
|
146
|
+
// Left as a flat rate rather than an `intro` whose `until` sits far in the
|
|
147
|
+
// future — a date nobody is watching is exactly what caused this.
|
|
148
|
+
'claude-sonnet-5': { input: 2, output: 10, cacheRead: 0.2, cacheCreate: 2.5 },
|
|
136
149
|
'claude-sonnet-4-6': { input: 3, output: 15, cacheRead: 0.3, cacheCreate: 3.75 },
|
|
137
|
-
|
|
150
|
+
// Haiku 4.5 is $1/$5. This carried $0.80/$4 — Haiku 3.5's row, copied
|
|
151
|
+
// wholesale including its cache rates — so every Haiku 4.5 cost read ~20%
|
|
152
|
+
// LOW. Found by check-pricing-drift.mjs on its very first run (#1048).
|
|
153
|
+
'claude-haiku-4-5': { input: 1, output: 5, cacheRead: 0.1, cacheCreate: 1.25 },
|
|
138
154
|
};
|
|
139
155
|
/**
|
|
140
156
|
* The per-1M-token rate for `model` in effect at `atMs` (epoch ms): the intro
|
|
@@ -155,7 +171,8 @@ export function pricingRateFor(model, atMs) {
|
|
|
155
171
|
}
|
|
156
172
|
function estimateCost(record) {
|
|
157
173
|
// Price each record at the rate effective at ITS OWN timestamp, so a window
|
|
158
|
-
// that spans a pricing cutover (
|
|
174
|
+
// that spans a pricing cutover (no model currently has one — Sonnet 5's
|
|
175
|
+
// scheduled increase was cancelled and its $2/$10 made permanent)
|
|
159
176
|
// estimates each side correctly rather than repricing history at today's rate.
|
|
160
177
|
const p = pricingRateFor(record.model, record.timestamp);
|
|
161
178
|
return ((record.inputTokens * p.input) +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.38",
|
|
4
4
|
"description": "Use your Claude Pro/Max subscription in any tool — Cursor, Cline, Aider, the Agent SDK, your scripts — at subscription pricing, not per-token API bills. One local Anthropic + OpenAI-compatible endpoint.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|