Commit 4c7e039
committed
feat(billing): add posthog code token spend analysis banner
Surfaces a self-serve spend analysis inside Settings -> Plan & usage.
Calls the new /api/llm_analytics/posthog_code_spend/ endpoint, renders
totals + breakdowns by ai_product / tool / model + top traces, and
generates inline heuristic suggestions on where to optimise. Footer
links to PostHog LLM analytics docs and the exploring-llm-costs skill.
Gated behind the posthog-code-spend-analysis feature flag (always on
in dev). Plan & usage section itself is also forced on in dev so the
banner is reachable without billing-flag setup.
Generated-By: PostHog Code
Task-Id: f9d5d152-49c6-46cf-8fde-079105ba2e671 parent 677f026 commit 4c7e039
6 files changed
Lines changed: 505 additions & 1 deletion
File tree
- apps/code/src/renderer
- api
- features
- billing
- components
- hooks
- types
- settings/components
- sections
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
2854 | 2855 | | |
2855 | 2856 | | |
2856 | 2857 | | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
2857 | 2878 | | |
0 commit comments