{# HTMX partial: cost breakdown panel. Loaded on click of the cost stat card. #} {% set month_spend = cost_stats.month %} {% set budget_pct = (month_spend / budget_cap * 100) if budget_cap > 0 else 0 %} {% if budget_pct >= 100 %} {% set bar_color = "bg-red-500" %} {% set pct_text = "text-red-400" %} {% elif budget_pct >= 80 %} {% set bar_color = "bg-amber-500" %} {% set pct_text = "text-amber-400" %} {% else %} {% set bar_color = "bg-emerald-500" %} {% set pct_text = "text-emerald-400" %} {% endif %}

Cost Breakdown

{{ "%.0f" | format(budget_pct) }}% of budget used
This month: ${{ "%.2f" | format(month_spend) }} Cap: ${{ "%.0f" | format(budget_cap) }}
Today
${{ "%.3f" | format(cost_stats.today) }}
This Week
${{ "%.3f" | format(cost_stats.week) }}
Projected/mo
${{ "%.2f" | format(cost_stats.projected_monthly) }}
{% if cost_stats.by_feature %}
By Feature
{% for item in cost_stats.by_feature %} {% endfor %}
Feature Calls Spend
{{ item.purpose }} {{ item.calls }} ${{ "%.4f" | format(item.spend) }}
{% else %}

No API calls recorded yet.

{% endif %}
Adjust budget in Settings →