explain_cost_change
Explain a specific cost change: which timeline events line up with it, how strongly, and how much of the move Plutus could account for. Ask this about any point on a cost chart — it is not limited to anomalies the detector flagged (use list_anomalies for those; each already carries the same explanation).
RENDER explanation.sentences AS WRITTEN. They are generated under a strict discipline and are the only phrasing this data supports: Plutus reports temporal and dimensional evidence, never causation. Each candidate carries a claim of "coincides" (temporal proximity only — the common case), "consistent_with" (proximity plus a confirmed link between that event source and this cost entity) or "accounts_for" (a known dollar amount that matches the move). Do not upgrade one to another, do not say an event "caused" or "led to" the change, and do not merge several candidates into a single narrative.
Three separate numbers, never interchangeable: change_evidence is how sure we are a real change-point exists at all; attribution_completeness is what fraction of the move was localized to a specific part of the bill (a low value means "we do not know what this spend is yet", which is NOT the same as "nothing explains it"); p_cause is per candidate, and sums with p_unknown to 1. tier: "unknown" means we looked and found nothing that lines up — say that, rather than reaching for the top-ranked candidate anyway. Confidence is capped at 0.60 by design; there is no "high" tier today.
Body: dimension + value name the slice (e.g. service=AmazonEC2), optional cost_source_id narrows it, and exactly one of day or range says when. A range is narrowed to the single biggest-moving day inside it, reported as explained_day. Mirrors POST /api/accounts/:accountId/cost-changes/explain.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| day | No | YYYY-MM-DD — the day to explain | |
| range | No | Half-open YYYY-MM-DD range; narrowed to its biggest-moving day | |
| value | Yes | The dimension value that moved, e.g. "AmazonEC2" | |
| dimension | Yes | Which dimension names the slice | |
| cost_source_id | No | Narrow to one cost source, e.g. "aws" |