name: price-check description: Verify and refresh AI model pricing in Chatty's pricing.py from official provider pricing pages, and regenerate PRICING.md. Run during any PR that touches providers or usage. Skips re-fetching if pricing was already verified earlier in the current chat. Only operates inside the Chatty repo.
price-check
Keeps backend/core/providers/pricing.py (MODEL_PRICING + PRICING_SOURCES) current with published per-token rates and regenerates the reviewable report backend/core/providers/PRICING.md. No provider's models API exposes price, so this skill is the maintenance mechanism that keeps the usage/cost dashboard accurate as new models are added dynamically.
When to run
- During any PR that adds/changes models or touches
core/providers/orcore/agents/usage/(required by the projectCLAUDE.md→ Model Pricing). - On request: "check prices", "refresh model pricing", "is pricing current?".
Guard 1 — ship only in the Chatty repo
Before writing or committing anything, confirm this is the Chatty repo:
git remote -vcontainswwilson1017/chatty, ORCLAUDE.mdstarts with# ChattyANDbackend/core/providers/pricing.pyexists.
If neither holds, STOP: report that price-check only runs in the Chatty repo, and make no changes.
Guard 2 — skip if already verified this chat
If model pricing was already fetched/verified earlier in THIS conversation, or backend/core/providers/PRICING.md already shows Last verified: <today> with no pending diff, do NOT re-fetch. Reuse the in-session results and report "already current". Re-fetching wastes calls and risks rate limits.
Procedure
- Model set. Union of the keys in
MODEL_PRICINGand each provider's current model list — the fallback*_MODELSconstants, plus (if credentials are configured) whatGET /api/providers/{provider}/modelsreturns. This prices newly-surfaced dynamic models, not just legacy ones. - Fetch current STANDARD-tier rates (USD per 1M input / output tokens) via WebFetch from the official pages:
- Anthropic —
https://platform.claude.com/docs/en/about-claude/models/overview - OpenAI —
https://developers.openai.com/api/docs/pricing - Google —
https://ai.google.dev/gemini-api/docs/pricing - Together —
https://www.together.ai/pricingRecord tier caveats (e.g. Gemini 2.5 Pro is the ≤200K-prompt tier) in a code comment.
- Anthropic —
- Diff against the current
MODEL_PRICING; classify each model: added / changed / unchanged / unverifiable. - Never fabricate. If a model's rate isn't on the official page, leave it OUT of
MODEL_PRICINGand report it as "unknown" — the usage dashboard already flags unpriced paid models (is_priced/ per-agenthas_unknown_pricing). Do NOT guess from memory or community posts. - Write
backend/core/providers/pricing.py:MODEL_PRICING[model] = (input, output)PRICING_SOURCES[model] = (source_url, "<YYYY-MM-DD>")— use the current session date. Keep proven legacy entries (the dashboard prices historical rows by model id via longest-prefix match).
- Regenerate
backend/core/providers/PRICING.mdfrom the updatedpricing.py(do not hand-author divergent numbers): a header lineLast verified: <YYYY-MM-DD> (price-check)followed by a per-provider tablemodel | input $/M | output $/M | source | verified. - Report a concise diff table to the user. When run during a PR, also place the diff in the PR description.
Commit
- Commit
pricing.pyandPRICING.mdtogether, e.g.Refresh model pricing (price-check <YYYY-MM-DD>). - No
Co-Authored-Byor "Generated with Claude Code" footers (repo policy). - Never commit secrets; never run
gcloud secrets/--set-secretscommands.
Notes
- The session date is authoritative for the
verifieddate — read it from the environment context, don't compute it in code. - This skill is committed into the Chatty repo so it travels with the project; it is the canonical place to evolve the pricing-refresh workflow.
Architecte Docker Compose
DevOps
Concoit des configurations Docker Compose optimisees.
Rapport de Post-Mortem
DevOps
Rédige des rapports post-mortem d'incidents structurés et blameless.
Créateur de Runbooks
DevOps
Crée des runbooks opérationnels clairs pour les procédures DevOps courantes.