Skip to content

feat(billing): migration 042 — seed Claude Sonnet 5 COGS, retire Sonnet 4.6#53

Merged
I-am-nothing merged 2 commits into
mainfrom
feat/ai-model-pricing
Jul 7, 2026
Merged

feat(billing): migration 042 — seed Claude Sonnet 5 COGS, retire Sonnet 4.6#53
I-am-nothing merged 2 commits into
mainfrom
feat/ai-model-pricing

Conversation

@I-am-nothing

@I-am-nothing I-am-nothing commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Migration 042 — per-model AI pricing catch-up for the 4-Claude roster.

  • Seeds Claude Sonnet 5 (anthropic.claude-sonnet-5) raw COGS into ms_billing.metric_model_prices: input 3000 / output 15000 / cache_write 3750 / cache_read 300 µ$/1k (Anthropic standard list price $3/$15, = USD-per-1M × 1000). The ×1.2 markup is applied once at rollup, never stored — same RAW-COGS contract as migration 018.
  • Retires Sonnet 4.6 (active = false, rows kept for historical reproducibility — never deleted; the rollup filters active = true).
  • Opus 4.8 / Fable 5 stay unseeded while disabled (no adapter emit ⇒ dead pricing); they join the seed when enabled. Haiku 4.5 untouched.
  • Down re-activates Sonnet 4.6 and drops the Sonnet 5 rows.
  • Also repairs scripts/init-db.sql, which had drifted (missing the \i line for migration 041).

Verified on the live dev Postgres: up applies clean, re-run idempotent, down reverses exactly to the 018 seed state.

Companion to api-platform's 4-Claude roster PR.

🤖 Generated with Claude Code

I-am-nothing and others added 2 commits July 7, 2026 07:43
…et 4.6

Seeds per-model raw COGS for Claude Sonnet 5 into metric_model_prices
(input 2000 / output 10000 / cache_write 2500 / cache_read 200 µ$/1k =
USD-per-1M x1000; the x1.2 markup is applied once at rollup, not stored) and
deactivates the dropped Sonnet 4.6 rows (active=false, kept for historical
reproducibility — never deleted). Opus 4.8 / Fable 5 stay unseeded while
disabled (no adapter emit = dead pricing); Haiku 4.5 untouched. Down
re-activates Sonnet 4.6 and drops the Sonnet 5 rows. Also repairs init-db.sql,
which had drifted (missing the 041 \i line).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… µ$/1k)

Match the api-platform roster: seed Sonnet 5 at the standard list price rather
than the intro $2/$10, so it doesn't need a Sep 1 2026 hotfix.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@I-am-nothing I-am-nothing merged commit ede26bf into main Jul 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant