Skip to content

bug: TOOL_COSTS credit values don't match canonical spec #58

@stackbilt-admin

Description

@stackbilt-admin

Problem

src/cost-attribution.ts defines credit costs as:

// image_generate
baseCost: 5
// with quality multipliers:
//   draft   × 1 = 5 cr
//   premium × 3 = 15 cr
//   ultra   × 5 = 25 cr

The canonical credit spec defines:

Quality tier Credits
draft 1 cr
standard 2 cr
premium 4 cr
ultra 8 cr
ultra_plus 10 cr

The canonical spec is the source of truth. TOOL_COSTS is approximately 5× over the spec for every tier.

Impact

  • At current TOOL_COSTS values, a 500-credit pack ($9.99) buys ~100 draft calls instead of ~500
  • The pricing math on the purchase flow and the actual deduction are misaligned
  • Cost audit (scheduled 3-5 days post-deploy) will catch per-unit economics, but this needs to be corrected before that audit is meaningful

Fix

Align TOOL_COSTS to the canonical table. The quality multiplier approach can stay — just rebased from the correct baseCost:

// draft=1, standard=2, premium=4, ultra=8, ultra_plus=10
image_generate: {
  baseCost: 1,
  qualityMultipliers: { draft: 1, standard: 2, premium: 4, ultra: 8, ultra_plus: 10 },
}

Or enumerate each tier directly. Either way, the canonical spec wins.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions