xml-pipeline/xml_pipeline/server
dullfig 860395cd58 Add usage/gas tracking REST API endpoints
Endpoints:
- GET /api/v1/usage - Overview with totals, per-agent, per-model breakdown
- GET /api/v1/usage/threads - List all thread budgets sorted by usage
- GET /api/v1/usage/threads/{id} - Single thread budget details
- GET /api/v1/usage/agents/{id} - Usage totals for specific agent
- GET /api/v1/usage/models/{model} - Usage totals for specific model
- POST /api/v1/usage/reset - Reset all usage tracking

Models:
- UsageTotals, UsageOverview, UsageResponse
- ThreadBudgetInfo, ThreadBudgetListResponse
- AgentUsageInfo, ModelUsageInfo

Also adds has_budget() method to ThreadBudgetRegistry for checking
if a thread exists without auto-creating it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 21:20:36 -08:00
..
__init__.py Add AgentServer REST/WebSocket API 2026-01-27 20:22:58 -08:00
api.py Add usage/gas tracking REST API endpoints 2026-01-27 21:20:36 -08:00
app.py Add AgentServer REST/WebSocket API 2026-01-27 20:22:58 -08:00
models.py Add usage/gas tracking REST API endpoints 2026-01-27 21:20:36 -08:00
state.py Add capability introspection REST endpoints 2026-01-27 20:51:17 -08:00
websocket.py Add AgentServer REST/WebSocket API 2026-01-27 20:22:58 -08:00