aws ce get-cost-forecast
aws ce get-cost-forecast predicts your AWS spend for a future date range from your past usage. Use --metric UNBLENDED_COST, --granularity MONTHLY and a --time-period that starts today or later; add --prediction-interval-level 80 to get a low and high estimate around the mean.
What the command does
Cost Explorer fits a forecast to your historical spend and returns a mean value for the whole period (Total.Amount) and per time bucket (ForecastResultsByTime). With a prediction interval, each bucket also has PredictionIntervalLowerBound and PredictionIntervalUpperBound.
The forecast only knows about the past. A new workload launched yesterday, or a large reservation purchase, will not be reflected properly until there is history to learn from.
Syntax
aws ce get-cost-forecast \
--time-period Start=<today-or-later>,End=<YYYY-MM-DD> \
--metric UNBLENDED_COST|AMORTIZED_COST|... \
--granularity MONTHLY|DAILY \
[--prediction-interval-level 51-99] \
[--filter file://filter.json]Worked examples
Projected spend for the rest of this month. Add the result to month-to-date actuals from get-cost-and-usage to estimate the full bill:
aws ce get-cost-forecast \
--time-period Start=2026-11-16,End=2026-12-01 \
--metric UNBLENDED_COST --granularity MONTHLY \
--query "Total.[Amount,Unit]" --output textWith an 80% prediction interval:
aws ce get-cost-forecast \
--time-period Start=2026-11-16,End=2026-12-01 \
--metric UNBLENDED_COST --granularity MONTHLY \
--prediction-interval-level 80 \
--query "ForecastResultsByTime[0].[MeanValue,PredictionIntervalLowerBound,PredictionIntervalUpperBound]" \
--output textNext three months, one figure per month:
aws ce get-cost-forecast \
--time-period Start=2026-12-01,End=2027-03-01 \
--metric UNBLENDED_COST --granularity MONTHLY \
--query "ForecastResultsByTime[].[TimePeriod.Start,MeanValue]" --output textForecast for one service, using the same filter syntax as get-cost-and-usage:
aws ce get-cost-forecast \
--time-period Start=2026-11-16,End=2026-12-01 \
--metric UNBLENDED_COST --granularity DAILY \
--filter '{"Dimensions":{"Key":"SERVICE","Values":["Amazon Elastic Compute Cloud - Compute"]}}' \
--query "Total.Amount" --output textScript it with today's date (GNU date):
start=$(date +%F)
end=$(date -d "$(date +%Y-%m-01) +1 month" +%F)
aws ce get-cost-forecast --time-period Start=$start,End=$end \
--metric UNBLENDED_COST --granularity MONTHLY --query Total.Amount --output textOptions
| Option | Notes |
|---|---|
--metric | One value, in upper case: UNBLENDED_COST, AMORTIZED_COST, BLENDED_COST, NET_UNBLENDED_COST, NET_AMORTIZED_COST, USAGE_QUANTITY, NORMALIZED_USAGE_AMOUNT. |
--granularity | DAILY or MONTHLY for forecasts. |
--time-period | Start must be today or later; End is exclusive. |
--prediction-interval-level | Confidence level between 51 and 99. Higher means a wider range. |
--filter | Narrow by service, account, Region, tag and so on. |
Gotchas
- Metric spelling differs from get-cost-and-usage. There it is
UnblendedCost; here it isUNBLENDED_COST. Mixing them up gives a validation error. - Start in the past fails. A forecast cannot begin before today. For a full-month figure, combine actuals and forecast as shown above.
- Too little history. New accounts, or filters matching services you only just started using, may return an error saying there is not enough data to forecast.
- It is billed per request like other Cost Explorer API calls.
- Use budgets for alerts. A forecast is a number, not a notification. AWS Budgets can alert on forecasted spend; see setting up a billing alarm.
Questions
How do I get my forecasted AWS bill for this month from the CLI?
Run get-cost-forecast from today to the first day of next month with --granularity MONTHLY, then add month-to-date actual cost from get-cost-and-usage for the same month.
Why does get-cost-forecast say the start date is invalid?
The start of --time-period must be today or a later date. Past days are actuals, which you read with get-cost-and-usage.
Can I forecast cost per service?
Yes. Pass a --filter on the SERVICE dimension. get-cost-forecast does not support --group-by, so run one call per service you care about.
A forecast that jumps mid-month is worth knowing about before the invoice. CloudConsole is built to show cost trends next to alarms and resources on a phone.
About the app → · Download on the App Store