Versions in this module Expand all Collapse all v1 v1.5.0 Apr 2, 2026 v1.2.0 Mar 19, 2026 v0 v0.1.0 Apr 6, 2026 Changes in this version + var APIKey string + var Bind string + var Open bool + var Port int + func Cmd() *cobra.Command + func SetAllowedOrigins(origins []string) + type AlertConfig struct + DailyTokenLimit int64 + Enabled bool + UsageSpikeThreshold float64 + WeeklyTokenLimit int64 + type AllocationTagsWidget struct + Tags map[string]TagCost + TimeRange string + TotalCost float64 + func NewAllocationTagsWidget() *AllocationTagsWidget + func (w *AllocationTagsWidget) UpdateTagCost(tag string, cost float64) + type Anomaly struct + Description string + DetectedAt time.Time + Deviation float64 + Expected float64 + Severity string + Type string + Value float64 + type AnomalyDetectionWidget struct + Anomalies []Anomaly + LastScan time.Time + ScanInterval time.Duration + Sensitivity float64 + func NewAnomalyDetectionWidget() *AnomalyDetectionWidget + func (w *AnomalyDetectionWidget) AddAnomaly(anomaly Anomaly) + func (w *AnomalyDetectionWidget) GetHighSeverityAnomalies() []Anomaly + type BudgetCapWidget struct + AlertThreshold float64 + BudgetLimit float64 + BudgetRemaining float64 + BudgetUsed float64 + BurnRate float64 + DaysUntilCap int + IsAtRisk bool + UsagePercent float64 + func NewBudgetCapWidget() *BudgetCapWidget + func (w *BudgetCapWidget) UpdateBudget(limit, used float64) + type Client struct + type Config struct + Alerts AlertConfig + Bind string + EnableExport bool + HistoryRetention int + Port int + Theme string + UpdateInterval int + type Contribution3DData struct + Cells []ContributionCell3D + DateRange DateRange + MaxValue int + TotalValue int + Weeks int + type ContributionCell struct + Date string + Intensity float64 + Value int + X int + Y int + type ContributionCell3D struct + Date string + Intensity float64 + Value int + Weekday string + X int + Y int + Z float64 + type CostAlert struct + CreatedAt time.Time + ID string + Message string + ResolvedAt *time.Time + Severity string + Threshold float64 + Type string + Value float64 + type CostAlertsWidget struct + ActiveAlerts []CostAlert + AlertCount int + ResolvedAlerts []CostAlert + func NewCostAlertsWidget() *CostAlertsWidget + func (w *CostAlertsWidget) AddAlert(alert CostAlert) + func (w *CostAlertsWidget) ResolveAlert(id string) + type CostDataPoint struct + Cost float64 + Requests int64 + Timestamp time.Time + Tokens int64 + type CostPerRequestWidget struct + AverageCost float64 + CurrentCost float64 + LastUpdated time.Time + P95Cost float64 + P99Cost float64 + RefreshRate time.Duration + TimeRange string + TotalCost float64 + TotalRequests int64 + func NewCostPerRequestWidget() *CostPerRequestWidget + func (w *CostPerRequestWidget) Update(cost float64) + type CostProjection struct + CostSaved float64 + Cumulative float64 + Date string + TokensSaved int64 + type CostTrendWidget struct + Aggregation string + DataPoints []CostDataPoint + TimeRange string + func NewCostTrendWidget() *CostTrendWidget + func (w *CostTrendWidget) AddDataPoint(point CostDataPoint) + func (w *CostTrendWidget) GetTrend() string + type DashboardLayout struct + CreatedAt string + Description string + ID string + Name string + Panels []Panel + UpdatedAt string + func CreateDefaultLayout() *DashboardLayout + func StandardDashboardLayouts() []DashboardLayout + func (dl *DashboardLayout) AddPanel(panel Panel) + func (dl *DashboardLayout) GetPanel(id string) *Panel + func (dl *DashboardLayout) RemovePanel(id string) + func (dl *DashboardLayout) UpdatePanel(id string, updates Panel) bool + type DashboardState struct + AllocationTags *AllocationTagsWidget + AnomalyDetection *AnomalyDetectionWidget + BudgetCap *BudgetCapWidget + CostAlerts *CostAlertsWidget + CostPerRequest *CostPerRequestWidget + CostTrend *CostTrendWidget + ModelComparison *ModelComparisonWidget + PricingEditor *PricingEditorWidget + SpendForecast *SpendForecastWidget + TokenBreakdown *TokenBreakdownWidget + func NewDashboardState() *DashboardState + func (ds *DashboardState) String() string + func (ds *DashboardState) UpdateAll() + type DataPoint struct + Input int64 + Output int64 + Saved int64 + Timestamp int64 + type DateRange struct + End string + Start string + type HeatmapCell struct + Label string + Value int + X int + Y int + type HeatmapData struct + Cells []HeatmapCell + Max int + func GenerateHeatmap(commands []string, window time.Duration) HeatmapData + type LLMProvider struct + BaseURL string + CostInput float64 + CostOutput float64 + Model string + Name string + Type string + type LiveServer struct + func NewLiveServer() *LiveServer + func (s *LiveServer) Broadcast(msgType string, payload interface{}) + func (s *LiveServer) BroadcastTo(clientID string, msgType string, payload interface{}) + func (s *LiveServer) ClientCount() int + func (s *LiveServer) HandleWebSocket(w http.ResponseWriter, r *http.Request) + func (s *LiveServer) Start() + type LiveTicker struct + func NewLiveTicker(server *LiveServer, tracker *TokenTracker) *LiveTicker + func (t *LiveTicker) Start() + func (t *LiveTicker) Stop() + type Message struct + Payload interface{} + Type string + type ModelComparisonWidget struct + Models []ModelCostData + SelectedModel string + TimeRange string + func NewModelComparisonWidget() *ModelComparisonWidget + func (w *ModelComparisonWidget) AddModel(model ModelCostData) + func (w *ModelComparisonWidget) GetBestModel() *ModelCostData + type ModelCostData struct + AvgLatency time.Duration + CostPerToken float64 + ErrorRate float64 + Name string + QualityScore float64 + TotalCost float64 + TotalRequests int64 + type ModelPricing struct + CachePrice float64 + EffectiveDate time.Time + InputPrice float64 + ModelName string + OutputPrice float64 + type Panel struct + Config PanelConfig + ID string + Position Position + Size Size + Title string + Type PanelType + type PanelConfig struct + Aggregation string + Filters map[string]string + Metrics []string + RefreshInterval int + TimeRange string + type PanelType string + const PanelAllocationTags + const PanelAnomalyDetect + const PanelBudgetCap + const PanelCostAlerts + const PanelCostPerRequest + const PanelCostTrend + const PanelModelCompare + const PanelPricingEditor + const PanelSpendForecast + const PanelTokenBreakdown + type Position struct + X int + Y int + type PricingEditorWidget struct + Currency string + LastUpdated time.Time + Models map[string]ModelPricing + func NewPricingEditorWidget() *PricingEditorWidget + func (w *PricingEditorWidget) GetModelPricing(model string) (ModelPricing, bool) + func (w *PricingEditorWidget) SetModelPricing(model string, pricing ModelPricing) + type ProjectionRequest struct + Days int + GrowthRate float64 + Model string + type ProjectionResponse struct + CostPer1M float64 + Model string + Projections []CostProjection + Summary ProjectionSummary + type ProjectionSummary struct + DailyAverage float64 + ProjectedMonthly float64 + ProjectedYearly float64 + TotalCostSaved float64 + TotalTokensSaved int64 + type Size struct + Height int + Width int + type SpendForecastWidget struct + BudgetLimit float64 + ConfidenceHigh float64 + ConfidenceLow float64 + CurrentSpend float64 + DaysRemaining int + ForecastDate time.Time + GrowthRate float64 + ProjectedMonthly float64 + ProjectedYearly float64 + func NewSpendForecastWidget() *SpendForecastWidget + func (w *SpendForecastWidget) UpdateForecast(current, projected, growth float64) + type TagCost struct + Cost float64 + Percentage float64 + Tag string + Trend float64 + type TokenBreakdownWidget struct + Breakdown map[string]TokenCost + CacheCost float64 + CacheTokens int64 + CostPerToken float64 + InputCost float64 + InputTokens int64 + OutputCost float64 + OutputTokens int64 + TimeRange string + TotalCost float64 + TotalTokens int64 + func NewTokenBreakdownWidget() *TokenBreakdownWidget + func (w *TokenBreakdownWidget) UpdateBreakdown(inputTokens, outputTokens, cacheTokens int64, ...) + type TokenCost struct + Cost float64 + Percentage float64 + Tokens int64 + Type string + type TokenTracker struct + func NewTokenTracker() *TokenTracker + func (t *TokenTracker) GetHistory() []DataPoint + func (t *TokenTracker) GetStats() map[string]interface{} + func (t *TokenTracker) Record(input, output int)