Skip to main content
Custom credit consumption formulas allow you to define how usage events convert into credit deductions for metered features. This provides fine-grained control over consumption logic and supports advanced pricing models where usage is not uniform.

Overview

Custom formulas enable you to specify how event dimensions (e.g., token count, file count, duration) influence credit burn. Each metered feature can define its own formula. Stigg then applies the formula in real time when usage events are reported. This feature works with all existing credit-based pricing models and integrates automatically with credit enforcement, metering, and the credit ledger. Use this feature if:
  • Your usage events contain multiple metadata fields that affect cost.
  • Different workloads or models should consume credits at different rates.
  • You need more accuracy than fixed per-unit pricing provides.
  • Your product uses AI, media processing, data transformations, or variable-intensity workloads.

Key capabilities

  • Custom event-based formulas – Define mathematical expressions that map event dimensions to credit consumption.
  • Per-feature calculation – Each metered feature can apply a different formula.
  • Use event dimensions as parameters – Reference dimensions such as tokens, files_processed, or any event metadata field.
  • Real-time deduction – Credits are deducted immediately upon event ingestion.
  • Full audit trail – All calculations are visible in the credit ledger, including parameter values and resulting credit burn.

Example use cases

Multi-input processing

For events that include multiple workload types (e.g., documents, emails, images):
credits_used = (a × documents) + (b × emails) + (c × images)

Multi-model LLM operations

For workflows that include several LLM calls with different weights:
credits_used = (1.1 × model1_tokens) + (1.5 × model2_tokens) + (5 × model3_tokens)

Uniform token-based deduction

If each agent or sub-model contributes separate token counts:
credits_used = agent1_tokens + agent2_tokens + agent3_tokens

Configuration guide

  1. Go to Product catalog.
  2. Select Plans.
  3. Select a plan.
  4. Select Edit.
  5. Scroll down to the Price section.
  6. Click Edit.
  7. In the Set price section, scroll down to Credit consumption.
  8. Select the configuration, for example, Prototype generations.
  9. Set the Calculation mode to Advanced formula.
  10. Enter the forumula into the formula field.
  11. Click Save changes.
  12. Click Review and publish.
  13. Set what the changes will affect.
  14. Click Publish changes.