package models type Account struct { ID int `json:"id"` APIKey string `json:"api_key"` Name string `json:"name"` Credits int `json:"credits"` Unlimited bool `json:"unlimited"` Disabled bool `json:"disabled"` IsPremium bool `json:"is_premium"` IsAdmin bool `json:"is_admin"` PremiumDiscountPct int `json:"premium_discount_pct,omitempty"` CreatedAt interface{} `json:"created_at,omitempty"` } type AccountCreateRequest struct { Name string `json:"name"` Credits int `json:"credits,omitempty"` Unlimited bool `json:"unlimited,omitempty"` IsPremium bool `json:"is_premium,omitempty"` } type AccountUpdateRequest struct { Name *string `json:"name,omitempty"` Credits *int `json:"credits,omitempty"` Unlimited *bool `json:"unlimited,omitempty"` IsPremium *bool `json:"is_premium,omitempty"` Disabled *bool `json:"disabled,omitempty"` } type AddCreditsRequest struct { Credits int `json:"credits"` } type SetCreditsRequest struct { Credits int `json:"credits"` } type DisableAccountRequest struct { Disabled bool `json:"disabled"` } type AccountStatsResponse struct { Success bool `json:"success,omitempty"` Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` Account *Account `json:"account,omitempty"` UsageStats map[string]int `json:"usage_stats,omitempty"` TotalRequests int `json:"total_requests,omitempty"` CreditsUsed int `json:"credits_used,omitempty"` } type AdminResponse struct { Success bool `json:"success,omitempty"` Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` Account *Account `json:"account,omitempty"` Accounts []Account `json:"accounts,omitempty"` } // credit_usage_log models type CreditUsageLog struct { ID int64 `json:"id"` AccountID int64 `json:"account_id"` AccountName string `json:"account_name"` Endpoint string `json:"endpoint"` Path string `json:"path"` Method string `json:"method"` EndpointCost int64 `json:"endpoint_cost"` CreditsCharged int64 `json:"credits_charged"` StatusCode int64 `json:"status_code"` CreatedAt string `json:"created_at"` } type CreditUsageLogsResponse struct { Logs []CreditUsageLog `json:"logs"` Count int `json:"count"` Error string `json:"error,omitempty"` } type CreditUsageEndpointStat struct { Endpoint string `json:"endpoint"` TotalCalls int64 `json:"total_calls"` SuccessCalls int64 `json:"success_calls"` EndpointCost int64 `json:"endpoint_cost"` TotalCharged int64 `json:"total_charged"` } type CreditUsageByEndpointResponse struct { From string `json:"from"` To string `json:"to"` Endpoints []CreditUsageEndpointStat `json:"endpoints"` Count int `json:"count"` Error string `json:"error,omitempty"` } type CreditUsageAccountStat struct { AccountID int64 `json:"account_id"` AccountName string `json:"account_name"` Endpoint string `json:"endpoint"` TotalCalls int64 `json:"total_calls"` TotalCharged int64 `json:"total_charged"` LastCall string `json:"last_call"` } type CreditUsageByAccountResponse struct { From string `json:"from"` To string `json:"to"` Accounts []CreditUsageAccountStat `json:"accounts"` Count int `json:"count"` Error string `json:"error,omitempty"` }