You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GET /costs — filters: agent, model, from, to, group_by (agent|model|hour|day). Response: total_usd, total_requests, total_input_tokens, total_output_tokens, breakdown[].
GET /costs/export — same filters, returns text/csv with Content-Disposition header. Columns: agent, model, provider, requests, input_tokens, output_tokens, cost_usd.
Parameterized SQL queries in internal/storage/.
Tests
Unit: filter by agent; filter by date; group_by hour/model; empty → zero totals; CSV valid headers.
Integration (scripts/test-cost-api.sh): send requests from different agents; query with filters; download CSV.
Commit message
feat: add cost API filters and CSV export
- Full filter support (agent, model, date range, group_by)
- CSV export endpoint with proper Content-Disposition
- Parameterized SQL queries for all filters
Branch:
feature/0.1.1-cost-api-filters-exportVersion: v0.1.1 — Gate Completion
Build
GET /costs— filters:agent,model,from,to,group_by(agent|model|hour|day). Response:total_usd,total_requests,total_input_tokens,total_output_tokens,breakdown[].GET /costs/export— same filters, returnstext/csvwithContent-Dispositionheader. Columns: agent, model, provider, requests, input_tokens, output_tokens, cost_usd.internal/storage/.Tests
scripts/test-cost-api.sh): send requests from different agents; query with filters; download CSV.Commit message