
Skill
signals-scout-ai-cost
monitor AI feature costs and performance
Description
Watches cost per conversation for AI features and reports when it breaks from its recent norm while volume holds steady, attributing the change to a model, prompt, cache, or retry cause.
SKILL.md
AI spend that jumps overnight
Watch unit economics for AI features, not the total bill.
Narrower than signals-scout-ai-observability, which rotates through cost, latency, errors,
volume and eval lenses and deliberately does not run every lens each tick. Run this one when
cost is the thing you want watched every day rather than whenever the rotation reaches it. If
you already run the canonical scout and cost regressions are surfacing in time, you don't need
both.
Discriminator
Emit a report when cost per conversation rises above its trailing 14-day norm while conversation volume stays within its own normal range. Write nothing when total cost rose but cost per conversation is flat – that is usage growth.
The bar
A starting threshold, to be tuned against what this team's data actually does:
- ≥1.5× the trailing 14-day median cost per conversation, sustained across two consecutive complete days, or
- ≥2× for a single complete day, where volume is within ±25% of its own 14-day median.
Use complete days only – a partial day reads as a spike every time. If the team's baseline is genuinely noisy, widen the bar and write what you chose to the scratchpad rather than lowering it and filing marginal reports.
Explore
- Compute daily cost per conversation over the last 14 days: total generation cost divided by
distinct conversations –
$ai_trace_id, or$ai_session_idwhere a conversation spans traces – split per feature. - Where a day clears the bar, decompose it. Check in this order, roughly the order of
likelihood:
- Model changed – compare the model distribution before and after.
- Cache hit rate dropped – compare
$ai_cache_read_input_tokensas a share of input tokens. A system-prompt edit invalidates the cache prefix and multiplies input cost with no change to model, token count, or generation count, so every other check here comes back clean while the bill climbs. Check it early. - Prompt grew – compare median input tokens per generation.
- Retries – compare generations per conversation, and check
$ai_is_erroron the same generation stream. - Output grew – compare median output tokens.
- If retries look like the cause, confirm the failures actually cost money. A 429 rejection
bills nothing; only failures after the provider started generating do – timeouts mid-stream,
max_tokenstruncation, malformed tool output, guardrail rejections. Check$ai_http_statusand$ai_stop_reason, and confirm the failed generations carry non-zero cost before calling retries the cause. - Name the most likely cause in the report. A cost report without a cause is just an invoice.
- Where a deploy sits in the window, include the commit range.
Disqualifiers
- Conversation volume moved as much as cost did – that's growth.
- The change is a deliberate, announced model upgrade.
- The change follows a deliberate caching-strategy change – a shortened prefix or a switched cache TTL raises unit cost on purpose.
- The provider changed its prices. This scout does not watch price lists, so confirm the per-token rate is unchanged before attributing a rise to your own code.
- The window covers a backfill, replay, or eval run rather than real traffic.
- The feature is new enough that there's no stable norm to compare against.
More skills from the posthog.com repository
View all 4 skillssignals-scout-flag-debt
identify and remove stale feature flags
Aug 10Feature FlagsObservabilityPostHogTech Debtsignals-scout-silent-failure
detect and diagnose silent application failures
Aug 10DebuggingMonitoringObservabilityPostHogsignals-scout-your-scout
configure PostHog signal scouts
Aug 10AutomationMonitoringObservabilityPostHog
More from PostHog
View publisheranalyzing-expensive-users
analyze expensive users in AI observability
posthog
Aug 10AnalyticsCost OptimizationObservabilityPostHogauditing-endpoints
audit PostHog project endpoints
posthog
Jun 8AnalyticsAuditPostHogauditing-warehouse-source-health
audit PostHog data warehouse source health
posthog
Jun 18AuditData WarehouseObservabilityPostHogauditing-warehouse-view-health
audit PostHog materialized view health
posthog
Jun 18AuditData WarehousePerformancePostHogauthoring-error-tracking-alerts
author PostHog error tracking alerts
posthog
Jun 18AlertingDebuggingObservabilityPostHogauthoring-log-alerts
author log alerts in PostHog
posthog
Jul 18AnalyticsMonitoringObservabilityOperations +1