Skip to main content
POST
/
cost-insights
/
compare
Compare costs across periods
curl --request POST \
  --url https://api.cloudcapital.co/v1/cost-insights/compare \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "baselinePeriod": {
    "start": "2026-02-01",
    "end": "2026-02-28"
  },
  "comparisonPeriod": {
    "start": "2026-01-01",
    "end": "2026-01-31"
  },
  "metric": "amortized_cost",
  "groupBy": {
    "dimension": "service",
    "dateGrouping": "daily"
  }
}
'
{
  "data": {
    "comparisons": [
      {
        "dimension_value": "<string>",
        "baseline": {
          "total": 123,
          "by_date": [
            {
              "date": "<string>",
              "value": 123
            }
          ]
        },
        "comparison": {
          "total": 123,
          "by_date": [
            {
              "date": "<string>",
              "value": 123
            }
          ]
        },
        "delta": {
          "absolute": 123,
          "percentage": 123
        }
      }
    ],
    "totals": {
      "baseline": 123,
      "comparison": 123,
      "delta": {
        "absolute": 123,
        "percentage": 123
      }
    },
    "metric_totals": {
      "amortized_cost": {
        "baseline": 123,
        "comparison": 123,
        "delta": {
          "absolute": 123,
          "percentage": 123
        }
      },
      "on_demand_cost": {
        "baseline": 123,
        "comparison": 123,
        "delta": {
          "absolute": 123,
          "percentage": 123
        }
      },
      "total_savings": {
        "baseline": 123,
        "comparison": 123,
        "delta": {
          "absolute": 123,
          "percentage": 123
        }
      },
      "effective_savings_rate": {
        "baseline": 123,
        "comparison": 123,
        "delta": {
          "absolute": 123,
          "percentage": 123
        }
      }
    },
    "metadata": {
      "baseline_period": {
        "start": "2026-01-01",
        "end": "2026-03-31"
      },
      "comparison_period": {
        "start": "2026-01-01",
        "end": "2026-03-31"
      },
      "baseline_label": "<string>",
      "comparison_label": "<string>"
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.cloudcapital.co/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

API key authentication. Generate an API key from your Cloud Capital dashboard under Settings > API keys. Include it in the Authorization header as a Bearer token.

Body

application/json
baselinePeriod
object
required
comparisonPeriod
object
required
metric
enum<string>
required

Metric to compare across periods

Available options:
amortized_cost,
billed_cost,
cash_cost,
on_demand_cost,
total_savings,
commitment_savings,
spot_savings,
effective_savings_rate
groupBy
object
required
filters
object

Filters for comparison (same structure as Filters but without dateRange/billingPeriods since periods are specified explicitly).

Response

Comparison data retrieved successfully

Successful HTTP responses wrap the endpoint-specific body in data. Each operation's 200 response schema is this object merged (allOf) with a data property referencing the payload schema for that endpoint.

success
enum<boolean>
required

Always true when the HTTP status is 2xx.

Available options:
true
data
object
required