Opsmeter logo
Opsmeter
AI Cost & Inference Control

Product economics

Cost per feature for AI: measure what each feature really costs

Feature-level cost visibility helps teams decide what to optimize, bundle, throttle, or reprice.

FeaturesAttributionUnit economics

Full guide: LLM cost attribution: endpoint, prompt version, tenant, and user

Define feature boundaries first

  • Map each user flow to one endpointTag taxonomy.
  • Separate critical and non-critical feature paths.
  • Track promptVersion by feature flow.

Pick the business action you are optimizing for

Cost per feature becomes useful when you tie it to a business action (an outcome), not just a request. Otherwise teams optimize tokens while margins still erode.

Define one primary action per feature and keep it stable across releases so trend lines are real.

  • Support: cost per resolved ticket (or cost per deflected ticket)
  • Sales: cost per qualified lead, cost per proposal generated
  • Docs/search: cost per answer with citations, cost per session
  • Devtools: cost per accepted suggestion, cost per build fix

Core formula

  • featureSpend = sum(request cost for endpointTag set)
  • featureVolume = request count for endpointTag set
  • featureCostPerAction = featureSpend / business action count

Include multipliers (the hidden spend that breaks unit economics)

Feature cost is rarely just one model call. Retries, fallbacks, tool calls, retrieval, and human review can multiply the true cost per action.

Treat these as first-class dimensions so a "cheap" model swap does not accidentally raise total cost.

  • Retries and timeouts (attempts per successful action)
  • Fallback routing to higher-cost tiers under error conditions
  • RAG and embeddings (retrieval configuration changes inputTokens)
  • Agent/tool steps (cost per workflow step, tool output bloat)
  • Rework loops (users ask for re-answers or edits)

Segment by tenant and plan before you make decisions

A feature may be profitable for enterprise tenants and unprofitable for self-serve users. Segmenting prevents blanket caps that harm your best customers.

If you are B2B, add tenantId early so you can tie feature cost to gross margin and expansion conversations.

  1. Rank feature spend by tenant and compute concentration percentage.
  2. Compare cost per action by plan tier (free vs paid).
  3. Set per-tenant guardrails for outliers (soft caps, alerts, or throttles).
  4. Review segment deltas weekly after promptVersion changes.

Decision workflow

  1. Rank features by total spend and cost per action.
  2. Flag features with high cost and low strategic value.
  3. Apply model tiering or token caps where acceptable.
  4. Re-check impact after prompt or routing changes.

Packaging and pricing actions this enables

  • Bundle low-cost features into default plans and upsell high-cost workflows.
  • Add usage-based pricing for endpoints with high variance.
  • Introduce fair-use caps for abusive or long-tail outliers.
  • Ship a "degraded mode" when budgets are exceeded (shorter outputs, fewer tools).

Business outcome

Cost-per-feature reporting turns engineering telemetry into packaging, pricing, and roadmap decisions.

What to send (payload example)

{
  "externalRequestId": "req_01HZXB6MQZ2WQ9D2KCF9M4V2QY",
  "provider": "provider_id",
  "model": "model_id",
  "endpointTag": "checkout.ai_summary",
  "promptVersion": "summary_v3",
  "userId": "tenant_acme_hash",
  "inputTokens": 540,
  "outputTokens": 180,
  "latencyMs": 892,
  "status": "success",
  "dataMode": "real",
  "environment": "prod"
}

Common mistakes

  • Missing endpointTag or using inconsistent naming across teams.
  • Not tagging promptVersion, so deploys cannot be linked to spend changes.
  • Sending raw user identifiers instead of hashed mapping for privacy.
  • Mixing demo/test dataMode into production operational reviews.

How to verify in Opsmeter Dashboard

  1. Use Overview to confirm spike window and budget posture.
  2. Use Top Endpoints to find feature-level concentration.
  3. Use Top Users to find tenant-level concentration.
  4. Use Prompt Versions to validate deploy-linked cost drift.

Related guides

Open pricingRead per-user guideCompare alternatives

Evaluation resources

For security and procurement reviews, use our trust summary before final tool selection.

Open trust proof pack