From pricing
Update LLM prices in the repo: Use this skill to snapshot live LLM pricing into a checked-in file so billing or cost math can run offline with deterministic rates. Use for any language or stack (TypeScript, Python, Go, JSON registries, etc.) — not only typescript. Use when the user wants pinned prices, wants to remove a runtime dependency on the Narev API, wants to refresh a committed pricing file, or mentions "snapshot pricing", "freeze prices", "pin model rates", "regenerate pricing file", "update pricing in the repo", or "sync token pricing from Narev".
How this skill is triggered — by the user, by Claude, or both
Slash command
/pricing:narev-update-llm-pricingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill is **not** a second API spec — it describes **what you can implement** using the **listing** API that `lookup-llm-pricing` documents (`GET https://www.narev.ai/api/models/pricing`): paginate, map each row to **your** schema, and write a committed file. For path/query/body contracts, `402`/`404`, and **`POST` calculate**, use `lookup-llm-pricing`. You do **not** need the Narev SDK or ...
This skill is not a second API spec — it describes what you can implement using the listing API that lookup-llm-pricing documents (GET https://www.narev.ai/api/models/pricing): paginate, map each row to your schema, and write a committed file. For path/query/body contracts, 402/404, and POST calculate, use lookup-llm-pricing. You do not need the Narev SDK or Vercel AI SDK — any HTTP client and file I/O in the repo's language is enough.
If the user only needs how the API works or cost for one call (POST calculate), point them at lookup-llm-pricing.
The Narev pricing API is public. No API key or bearer token is required.
provider values to refresh (API slugs), or the full catalog. Use the provider query parameter; omit it to fetch everything (paginate until page > meta.total_pages).1_000_000 only when writing that shape, and document it in the script.Paginate with page, limit (max 1000), and optional provider, model_id, search, subprovider. Response: { data: ModelPricingEntry[], meta: { total_pages, ... } }.
Each row has model_id, provider, subprovider, and pricing. When pricing is null, skip the row (enterprise-only or unavailable).
Useful pricing fields (snake_case, USD per unit unless noted):
| Field | Meaning |
|---|---|
price_prompt | Input token |
price_completion | Output token |
price_input_cache_read / price_input_cache_write | Cached input tokens |
price_internal_reasoning | Reasoning tokens |
pricing_request | Flat per request |
price_web_search | Per web-search invocation |
pricing_discount | Fraction 0–1, not a percent |
price_image, price_audio, price_input_audio_cache, etc. may appear — carry them through only if your local registry supports them.
Inspect the repo: find the existing pricing map or config and match key style (model_id only vs provider/model_id), units (per token vs per 1M tokens), and which fields the app reads.
Implement a script in the project's language (scripts/update-pricing.ts, scripts/update_pricing.py, etc.) that:
provider query values per run (or omit for full catalog).Document the run command in a comment or README snippet (pnpm tsx scripts/..., uv run python scripts/..., etc.).
Repos like Mission Control sometimes keep MODEL_PRICING in TypeScript with inputPerMTok / outputPerMTok. Adapt paths and regex to the real file:
provider repeated per catalog you care about, or no provider for full catalog.inputPerMTok = price_prompt * 1_000_000, same for completion.'model_id' and 'provider/model_id' if the app resolves either style.String.replace, write the file.This is illustrative — match the project's exact types and formatting.
@ai-billing/core offline resolver (optional)If the user already uses the Narev SDK, createObjectPriceResolver expects ModelPricing in USD per token (do not multiply to per-million for the SDK map). Map API → SDK like this:
Narev API (PricingData) | SDK (ModelPricing) |
|---|---|
price_prompt | promptTokens |
price_completion | completionTokens |
price_input_cache_read | inputCacheReadTokens |
price_input_cache_write | inputCacheWriteTokens |
price_internal_reasoning | internalReasoningTokens |
pricing_request | request |
price_web_search | webSearch |
pricing_discount | discount |
Output Record<string, ModelPricing> keyed by how the app resolves models (see multi-provider note below). Then:
import { createObjectPriceResolver } from "@ai-billing/core";
import { pricing } from "./pricing";
export const priceResolver = createObjectPriceResolver(pricing);
Providers, model subset (if any), output path, and whether units are per token or per 1M in the file.
Use the repo's language and dependencies (fetch / httpx / requests / urllib). Paginate GET https://www.narev.ai/api/models/pricing. Transform into the local schema. Prefer idempotent writes and small, reviewable diffs.
Use the project's package runner. Do not assume pnpm or tsx — check package.json, pyproject.toml, etc. Inspect the diff before committing.
For custom registries, point the app at the updated file or import. For @ai-billing/core, swap createNarevPriceResolver for createObjectPriceResolver as above.
CI on a schedule that runs the script and opens a PR keeps rates fresh with human review.
model_id. If you need per-provider rates, key with provider/model_id (and align lookup). Otherwise last write wins for bare model_id.pricing: null.pricing_discount is a fraction (0.1 = 10% off). Pass through if your registry supports it; many simple token maps ignore it./platform/api-reference/endpoint/pricing/list-model-pricing/sdk/ai-billing/indexcreateObjectPriceResolver: /sdk/ai-billing/reference/core/typedoc/functions/createObjectPriceResolvercreateNarevPriceResolver (live): /sdk/ai-billing/reference/core/typedoc/functions/createNarevPriceResolverModelPricing: /sdk/ai-billing/reference/core/typedoc/interfaces/ModelPricingProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub narevai/skills --plugin narev