Stigg Product Updates logo

Product Updates

Back to Homepage Subscribe to Updates

Labels

  • All Posts

Jump to Month

  • August 2026
  • July 2026
  • June 2026
  • April 2026
  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • August 2022
  • July 2022
  • June 2022
today

Prevent Unexpected Credit Charges: Preview Costs Before Executing Actions

Stigg now provides dedicated estimation endpoints for usage events and usage measurements.

The estimation uses the same credit calculation logic as actual usage consumption, but does not ingest the event or deduct credits.

For each relevant credit currency, the response includes:

  • estimatedCost — The number of credits the usage would consume
  • currentBalance — The customer’s current credit balance
  • balanceAfterEstimate — The projected balance after the estimated consumption
  • wouldOverdraft — Whether the operation would take the balance below zero
  • breakdown — A per-feature breakdown of the estimated credit cost
  • warnings — Any limitations or unsupported calculations encountered during estimation

Estimations support both customer-level and resource-level usage, including custom event dimensions.

⭐️ Why It Matters

For products with dynamic pricing models, such as LLM workflows, media rendering, or multi-step API pipelines, the credit cost of an action isn't always known up front.

Credit cost estimation enables you to:

  • Build pre-flight confirmation flows: Show customers an accurate estimate before launching an expensive task (e.g., "This image generation will cost ~15 credits. Proceed?").
  • Prevent mid-task overdrafts: Evaluate wouldOverdraft to block heavy jobs before execution if a user lacks sufficient credits.
  • Eliminate calculation drift: Ensure UI estimates perfectly match actual deductions by relying on Stigg's engine rather than re-implementing billing math in your frontend.

⚠️ Current Limitations

  1. Aggregation types: For event-based estimation, COUNT and SUM aggregations are supported. UNIQUE and MAX are not currently supported as they rely on historical aggregation state.
  2. Routing: Estimation endpoints are served through the standard Stigg REST API and are not currently routed via the Edge.

📦 Availability

Credit cost estimation is available now through the Stigg REST API and the following REST SDK versions or later:

  • TypeScript: v0.1.0-beta.43
  • Python: v0.1.0-beta.38
  • Go: v0.1.0-beta.39
  • Java: v0.1.0-beta.37
  • Ruby: v0.1.0-beta.41
Avatar of authorNoa Levi