← Zurück zu KI-Automatisierung und Kostenkontrolle

Skill · Version 1.0.0

Versionierte Preisberechnung

Berechnet Kosten nach unveränderlichen zeitgültigen Tarifen und trennt interne Kosten von Kundenbelastungen.

versioned-pricing-cost-calculation

Teammitglieder mit diesem Skill

Entdecke, wie der Skill hilft

Wann ist der Skill hilfreich?

Nutze dies bei Preiswechseln mit zu erhaltender historischer Abrechnungsbasis.

Wobei hilft er dir?

  • Speichert Preisversionen und angewendeten Tarif je Berechnung.
  • Behandelt Dimensionen, Staffelungen und genaue Geldeinheiten ausdrücklich.
  • Trennt Neuberechnungssimulationen von freigegebenen Buchungskorrekturen.

Das könntest du fragen

Berechne Nutzung über einen Preiswechsel und simuliere neue Tarife ohne historische Belastungen umzuschreiben. Teile Nutzung an der Gültigkeitsgrenze und erhalte angewandte Preise. Zeige hypothetische Einsparungen separat; historische Rechnungen bleiben mit ursprünglicher Berechnung abstimmbar.

Ausführliche Dokumentation

Hier findest du die ursprüngliche Anleitung, Beispiele und Prüfschritte des Skills in ihrer Originalsprache.

Details…Weniger anzeigen

Versioned Pricing & Cost Calculation

Provider rates and custom enterprise contracts change over time. Changing a price table today must never retroactively alter closed accounting periods unless an explicit repricing simulation or backfill is requested.

Workflow

  1. Model effective-dated, immutable rate cards:
    • Represent every rate entry with (provider, service, metricUnit, region, tier, effectiveFrom, effectiveTo, rateVersionId):
      • effectiveFrom (inclusive UTC timestamp) and effectiveTo (exclusive UTC timestamp, NULL for active rate).
      • Prevent overlapping intervals for the same (provider, service, metricUnit, region, tier) key via constraints or validation tests.
    • Support workspace-specific rate overrides (negotiated enterprise discounts or BYOK zero-markup passthrough) separate from upstream provider list prices.
  2. Distinguish internal COGS from customer billable rates:
    • Calculate and store internal provider cost (COGS) separately from external billable amount (managed by the billing specialist):
      • providerCostMicros: What the platform pays the upstream cloud/LLM provider.
      • listCostMicros: Standard list-price valuation (useful when running on pre-purchased commitments or credits).
    • Stamp each rated ledger entry with rateVersionId, unitPriceNumeric, and pricedAt so every row records the exact rate formula used.
  3. Support multi-dimensional and tiered pricing:
    • Per-unit linear rates: e.g., $3.00 / 1,000,000 input_tokens.
    • Context-length or processing tiers: e.g., higher per-token rates above 200k context tokens, or priority vs. batch/flex discounts (0.5x).
    • Graduated vs. volume tiers: Implement graduated tiers (first $N$ units at rate A, additional units at rate B) vs. volume tiers (entire volume repriced above threshold).
  4. Controlled repricing and simulation:
    • Match event.occurredAt (never recordedAt or NOW()) against [effectiveFrom, effectiveTo).
    • Provide a non-destructive simulation mode that evaluates historical usage against a candidate rateCardId without overwriting committed ledger entries.

Anti-Patterns to Avoid

  • Hardcoding model prices in code constants: Scattering const MODEL_PRICE = 0.03 makes rate updates require deploys and corrupts history.
  • Joining current price tables without occurredAt bounds: Computing last quarter's cost with today's price hides historical spend.
  • Silent fallback to $0 on unknown SKUs: Flag unknown models as pricingStatus: 'unpriced_sku' and alert rather than recording $0.00.

Enthaltene Dateien 1

  • SKILL.md