diff --git a/main.py b/main.py index 7602bb8..e7764d9 100644 --- a/main.py +++ b/main.py @@ -237,6 +237,31 @@ def telemetry_history(limit: int = 50): return {"history": get_store().history(limit=limit)} +@app.get("/billing/summary") +def get_billing_summary(): + try: + agent = BillingAgent() + return agent.get_summary() + except Exception as e: + return {"error": str(e)} + +@app.get("/billing/forecast") +def get_billing_forecast(): + try: + agent = BillingAgent() + return agent.get_forecast() + except Exception as e: + return {"error": str(e)} + +@app.get("/billing/anomalies") +def get_billing_anomalies(): + try: + detector = AnomalyDetector() + return detector.detect_anomalies() + except Exception as e: + return {"error": str(e)} + + if __name__ == "__main__": import uvicorn port = int(os.environ.get("PORT", 8080))