AI spend that jumps overnight
An LLM bill moves for one of two reasons: more conversations, or more cost per conversation. The first is growth. The second is a regression – a prompt grew, a model changed, a cache stopped hitting, a retry looped. This scout watches your LLM traces for the second kind.
What the scout looks at
The scout looks for patterns like Fig. 1: you deployed a new version of your feature at 09:14. Your conversation costs is rising, but volume is stable. This is a signal that LLM costs are rising. If both were rising, this is just growth.
Conversations
flat at ~1,200/day
Cost per conversation
$0.09 → $0.28
The report in your inbox
When your product emits signals that indicate AI costs are rising, a scout opens a report. Fig. 2 breaks the card down part by part. Click Review and the report opens Fig. 3 with the full evidence, the raw signals, and options to take action. Yours would look like this one, but name your events, your deploys, and your users.
Since yesterday's 09:14 deploy, conversations are flat at roughly 1,200/day but cost per conversation rose from $0.09 to $0.28. Generations per conversation went from 1.2 to 3.6 while input tokens and model distribution held steady. The extra generations carry non-zero cost and a max_tokens stop reason rather than a 429, so the provider billed for every retry – this is a retry loop, not a bigger prompt or a cache miss.
~$230/day above the 14-day norm
Suggested fix: Cap the retry count on the generation path and surface the underlying failure instead of retrying silently.
The pull request you merge
When you're ready to open a pull request, the agent does it for you, attaching the evidence along the way. You review and merge it like any other – nothing merges without you.
Reports are free. Pull requests are $15 each, with your first three a month free. See self-driving Pricing.
The scout itself
Scouts are the heart of the self-driving system – they're instructions an agent follows on a schedule – Fig. 4 is the actual file for this guide's custom scout.
It reads more than one signal source, so the report can name a likely cause, not just a number that moved.
Cost, tokens, model, cache reads, and error flags on every generation – enough to spot the change and attribute it.
Deploys, so a cost change can be tied to the commit that caused it rather than just a timestamp.
The schedule it runs on
This custom scout runs daily by default. You can choose to run it every 30 minutes up to once a day. It only writes when something is wrong, so most days it's silent.
Add this to your scout troop
This is how the scout appears in PostHog once it's running – a scheduled agent that files a report when it finds something.
Preview
- RequiredAI Observability instrumented, so $ai_generation events are arriving
- RequiredA property on generations identifying the feature, so you can split cost per surface
- RecommendedYour codebase connected via GitHub, to correlate a change against deploys
Not set up yet? One command installs PostHog, connects GitHub, and turns on a default troop of scouts. That troop doesn't include this one – add it above once you're set up.
npx @posthog/wizard self-driving