Cost Insights
How ServerBee turns billing fields, renewal schedules, and agent metrics into burn rate, per-resource unit cost, and objective cost advisories.
ServerBee combines admin-entered billing fields (price, billing_cycle, currency, billing_start_day, expired_at, traffic_limit, traffic_limit_type, and optional automatic renewal settings) with the resource capacity, utilization, and uptime each agent reports, then derives a set of objective cost signals: burn rate, per-resource unit cost, and per-server advisories. These appear in the server list (/servers), the dashboard server-cards widget in list layout (grid-layout <ServerCard> tiles omit cost figures), the cost panel on the server detail page, and the native iOS app (CostInsightsCard and fleet roll-ups in Insights).
To learn how to enter billing data in the UI, see the Billing Information section in the admin guide.
Derived outputs
Two read-only endpoints expose derived cost data:
GET /api/cost/overviewreturns fleet-wide per-currency totals undercurrencies(currency,configured_server_count,monthly_equivalent_total,daily_total,cycle_elapsed_total) plus a compactServerCostOverviewper server (omittingcycle_cost_remainingandresource_value).GET /api/servers/{id}/cost-insightsreturns the fullServerCostInsightsobject for one server, including cycle dates,price,cycle_cost_remaining, andresource_value.
| Field | Exposed on | Meaning |
|---|---|---|
configured | Both | Whether the server has a valid billing configuration |
price | cost-insights | Configured cycle price |
currency | Both | Billing currency code (defaults to USD when unset or blank) |
billing_cycle | Both | Normalized cycle (monthly, quarterly, or yearly) |
cycle_start / cycle_end | cost-insights | Inclusive calendar start and end dates (YYYY-MM-DD) of the current billing cycle |
cycle_days / days_elapsed | cost-insights | Total calendar days in the current cycle and days elapsed so far |
days_remaining | Both | Calendar days left in the current billing cycle (cycle_days - days_elapsed) |
cost_per_day / cost_per_hour / cost_per_second | Both | price divided by actual calendar cycle_days, then by 24 and 3600 |
cost_per_month_equivalent | Both | Cost normalized by month count (monthly = price, quarterly = price / 3, yearly = price / 12) |
cycle_cost_elapsed | Both | Money amortized so far in the current cycle (cost_per_day * days_elapsed) |
cycle_cost_remaining | cost-insights | Remaining money in the current cycle (max(price - cycle_cost_elapsed, 0)) |
cycle_burn_percent | Both | Elapsed portion of the cycle as a percentage (null when price == 0) |
resource_value.cost_per_cpu_core | cost-insights | Monthly-equivalent unit cost per CPU core |
resource_value.cost_per_gb_memory | cost-insights | Monthly-equivalent unit cost per GiB (1024^3 bytes) of memory |
resource_value.cost_per_gb_disk | cost-insights | Monthly-equivalent unit cost per GiB (1024^3 bytes) of disk |
resource_value.cost_per_tb_traffic_limit | cost-insights | Monthly-equivalent cost per TiB (1024^4 bytes) of traffic_limit, when configured with a valid traffic_limit_type (sum, up, down, or unset) |
resource_value.traffic_limit_type | cost-insights | Configured traffic accounting mode (sum, up, down), if any |
advisories | Both | Objective per-server warnings (see below); an empty array when nothing applies |
invalid_reason | Both | Populated instead of cost fields when billing fields fail validation |
ServerBee deliberately does not compute a single composite "value score". A server's cost-effectiveness is best judged from the objective unit costs above (which need no fleet comparison) plus the actionable advisories below, not from an opaque 0-100 number that conflates unrelated dimensions.
Input validation
The cost breakdown is skipped when any of the following are true. The reason is surfaced via invalid_reason so the UI can flag the entry rather than silently treating it as configured:
invalid_reason | Trigger |
|---|---|
missing_price | price is NULL |
missing_billing_cycle | billing_cycle is NULL or empty |
invalid_billing_cycle | billing_cycle is not in the recognized set (monthly, quarterly, yearly) |
invalid_price | price < 0 or NaN |
When currency is omitted or empty, it defaults to USD.
price == 0 is treated as a valid "free server" entry: monetary rates and elapsed/remaining amounts are 0.0, cycle_burn_percent is null, and the server never raises idle_burn or sleeping_money advisories (which only apply when money is being spent).
Automatic Renewal Tracking & Billing Calendar
Servers support opt-in automatic renewal tracking via the renewal object on POST /api/servers, PUT /api/servers/{id}, and GET /api/servers/{id}.
- Billing calendar & timezone: Clients submit a calendar date (
renewal.expiry_dateasYYYY-MM-DD) together with an IANArenewal.billing_timezone(defaults toUTC), rather than computing UTC boundaries on the client. ServerBee converts the date to the end-of-day boundary in that timezone. Submittingrenewal.expiry_datetogether with legacyexpired_atis rejected. - Prerequisites: Enabling
renewal.enabled = truerequires an expiry date, a valid IANAbilling_timezone, and amonthly,quarterly, oryearlybilling_cycle. - Response fields (
RenewalProjection):enabled,billing_timezone,expiry_date,confirmed_expired_at,deadline_origin, andoccurrence_id. deadline_originlifecycle:confirmed: An operator explicitly set or confirmed the expiry date (with automatic renewal off).projected: Automatic renewal is enabled. When the deadline passes, ServerBee advances it by 1, 3, or 12 months while preserving the original anchor day (clamping to the last day of shorter months, such as 31st to 28th/29th in February, without losing the anchor for subsequent cycles).frozen: Automatic renewal was turned off after a deadline had been projected; the projected date stays frozen in place until an operator confirms a new date.
- Offline catch-up: If the Server is offline across multiple billing periods, catch-up jumps directly to the first unexpired occurrence while keeping the original anchor day. Historical missed periods are never emitted as separate occurrences.
- Decoupled from cost cycle burn: Renewal tracking governs expiry dates and renewal reminders, whereas cost cycle burn (
cycle_start/cycle_end) is computed independently frombilling_cycleandbilling_start_day.
Automatic renewal tracking is a calendar forecast only. A projected deadline does not confirm that your hosting provider actually charged your payment method or renewed the server.
Cost advisories
Each advisory is an objective fact about a single server, computed without any fleet comparison, so it is meaningful even for a one-server deployment. They are emitted in the priority order below and rendered as warning chips next to the cost figures.
| Advisory | Trigger | What it suggests |
|---|---|---|
expired_billing | expired_at is in the past | Renew before you lose the host |
sleeping_money | Offline, with no recent samples, while paying a non-zero bill | Investigate why a paid host is down |
idle_burn | Resources idle (avg CPU < 5%, avg memory < 20%, no real network/disk I/O over the last 24h) while paying a non-zero bill | Consider downsizing or consolidating |
low_uptime | 30-day uptime ratio below 90% | Investigate reliability |
sleeping_money and idle_burn are mutually exclusive: "sleeping" requires the absence of recent samples, while "idle" requires the low-usage samples that prove the host was recently alive.
Data sources and refresh cadence
- Advisories and cost figures are computed on demand by the server; there is no persisted cache
- Utilization averages come from the
recordstable (the same table the monitoring charts use), 24h lookback (RECORD_LOOKBACK_HOURS). Network activity is judged from per-window throughput rates, not the cumulative byte counters - Uptime ratio is aggregated from
uptime_dailyover a 30-day lookback (UPTIME_RECENT_DAYS) - Resource capacity (CPU cores / total memory / total disk) comes from each agent's last
SystemInfo; the last known value is reused while the agent is disconnected
Known limitations
- Per-resource unit costs are absolute (cost ÷ capacity); they are not ranked against other servers, so judging "cheap vs. expensive" is left to you
idle_burninspects CPU + memory + I/O activity, not application-level usefulness. A host that is up but doing nothing useful while its CPU/RAM are idle reads as idlecost_per_tb_traffic_limitis omitted whentraffic_limitis missing ortraffic_limit_typeis outsidesum/up/downcost_per_month_equivalentdivides directly by calendar month count (1formonthly,3forquarterly,12foryearly), whereascost_per_daydivides by actual calendarcycle_daysin the current cycle- Memory, disk, and traffic unit costs use binary GiB (
1024^3bytes) and TiB (1024^4bytes) denominators even though the JSON field names usegbandtb - On dashboards, the
server-cardswidget renders cost figures only in list layout; grid layout cards omit cost data
Admin Guide
General settings, appearance branding, rate limits, backup and restore, user management, audit logs, remote commands, billing and renewal tracking, Agent Authority, and Tailscale administration.
API Reference
ServerBee REST API overview, authentication, WebSocket endpoints, and Swagger UI interactive docs.