Cost Optimization

Analyze and reduce your cloud infrastructure costs.

Features

  • Cost Dashboard - Real-time spending across all providers
  • Pricing Comparison - Compare costs across AWS, GCP, Azure, Hetzner, DigitalOcean
  • Right-Sizing - Recommendations for over/under-provisioned resources
  • Unused Resources - Identify idle servers and databases
  • Reserved Instances - Savings opportunities with committed use

Pricing Comparison

Compare equivalent instance types across providers:

GET /api/v1/costs/compare
{
  "cpu": 2,
  "memory_gb": 4,
  "providers": ["aws", "gcp", "hetzner", "digitalocean"]
}

Response:
{
  "comparisons": [
    {"provider": "hetzner", "type": "cx21", "monthly": 5.83},
    {"provider": "digitalocean", "type": "s-2vcpu-4gb", "monthly": 24.00},
    {"provider": "aws", "type": "t3.medium", "monthly": 30.37},
    {"provider": "gcp", "type": "e2-medium", "monthly": 33.52}
  ]
}

Cost Breakdown

GET /api/v1/costs/breakdown
{
  "total_monthly": 156.42,
  "by_provider": {
    "hetzner": 45.00,
    "aws": 111.42
  },
  "by_resource_type": {
    "servers": 120.00,
    "databases": 30.00,
    "storage": 6.42
  }
}

Optimization Recommendations

GET /api/v1/costs/recommendations

Response:
{
  "recommendations": [
    {
      "type": "right_size",
      "resource": "server-uuid",
      "current_type": "m5.xlarge",
      "recommended_type": "m5.large",
      "monthly_savings": 45.00,
      "reason": "CPU utilization < 20% over 30 days"
    },
    {
      "type": "unused",
      "resource": "server-uuid",
      "monthly_cost": 30.00,
      "reason": "No network traffic in 14 days"
    }
  ]
}

Budget Alerts

Set spending limits and get notified before overspending:

POST /api/v1/costs/budgets
{
  "name": "Monthly Limit",
  "amount": 500.00,
  "period": "monthly",
  "alert_thresholds": [50, 80, 100],
  "notification_channels": ["email", "slack"]
}