canonical: https://jentic.com/apis/amazonaws.com/ce

# AWS Cost Explorer Service

AWS Cost Explorer is the analytics API for AWS spend. It exposes the same data the Cost Explorer console renders, including cost and usage by service, account, tag, and dimension, programmatically with daily and monthly granularity. The API supports forecasting future costs and usage, detecting cost anomalies through anomaly monitors and subscriptions, retrieving Reserved Instance and Savings Plans coverage and utilisation, and getting purchase recommendations. Cost categories let you build custom rollups (by team, environment, or product) on top of raw cost data.

## For AI agents

Query AWS cost and usage data, forecast future spend, detect anomalies, and fetch RI and Savings Plans recommendations programmatically.

## Scope

Does not deliver line-item billing files, enforce spending thresholds, or purchase commitments. Use for cost and usage analytics, forecasting, and anomaly detection only.

## Capabilities

- Query cost and usage with GetCostAndUsage filtered and grouped by service, linked account, tag, region, or any cost dimension
- Generate cost and usage forecasts up to 12 months ahead with confidence intervals
- Define anomaly monitors and anomaly subscriptions that alert when spend deviates from baseline
- Retrieve Reserved Instance utilisation, coverage, and purchase recommendations
- Retrieve Savings Plans utilisation, coverage, and purchase recommendations
- Build cost categories that group spend by custom rules (account, tag, charge type) for executive reporting
- Get rightsizing recommendations for EC2 instances based on observed utilisation

## Use cases

### Monthly Cost Report by Team

Build a monthly internal cost report showing spend per team without exporting CSVs by hand. GetCostAndUsage filtered by linked account or tag (Team=*) and grouped by Tag returns spend per team in one call. Render the response into a Slack post or a Notion page so engineering managers see their share of the bill on the first business day of every month.

Example prompt: Call GetCostAndUsage with TimePeriod={Start: 2026-05-01, End: 2026-06-01}, Granularity=MONTHLY, Metrics=['UnblendedCost'], GroupBy=[{Type: TAG, Key: Team}].

### Quarterly Forecast for Finance

Give finance a forward-looking view of AWS spend so they can budget the next quarter accurately. GetCostForecast returns a point estimate plus 80 and 95 percent confidence intervals over a chosen horizon. Combine with usage forecasts to flag where committed spend (RIs or Savings Plans) under-covers the forecasted demand.

Example prompt: Call GetCostForecast with TimePeriod for the next 90 days, Metric=UNBLENDED_COST, Granularity=MONTHLY, PredictionIntervalLevel=95.

### Cost Anomaly Detection

Catch unexpected spend spikes, such as a forgotten dev cluster, an opened S3 bucket, or a misconfigured data transfer, within hours rather than at month end. CreateAnomalyMonitor defines a service-level or account-level monitor; CreateAnomalySubscription routes detected anomalies to email or SNS. GetAnomalies returns historical anomalies for review and tuning.

Example prompt: CreateAnomalyMonitor with MonitorType=DIMENSIONAL and DimensionalValueCount=10, then CreateAnomalySubscription with Threshold=100 USD and Subscribers=[{Type: EMAIL, Address: cost-alerts@company.com}].

### Agent-Driven Cost Investigator

When an alert fires, let an agent investigate the underlying spend pattern automatically: pull cost by service for the last 14 days, drill into the top growing service by usage type, and surface a probable root cause to the on-call engineer. The agent calls Cost Explorer through Jentic so AWS credentials never leave the vault, and runs the same investigation across multiple linked accounts in an organisation.

Example prompt: Search Jentic for 'get AWS cost grouped by service', execute it for the last 14 days, identify the service with the largest daily delta, then GetCostAndUsage grouped by USAGE_TYPE on that service to surface the top driver.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /#X-Amz-Target=AWSInsightsIndexService.GetCostAndUsage | Query cost and usage by dimension and group |
| POST | /#X-Amz-Target=AWSInsightsIndexService.GetCostForecast | Forecast future cost |
| POST | /#X-Amz-Target=AWSInsightsIndexService.GetUsageForecast | Forecast future usage |
| POST | /#X-Amz-Target=AWSInsightsIndexService.CreateAnomalyMonitor | Create a cost anomaly monitor |
| POST | /#X-Amz-Target=AWSInsightsIndexService.CreateAnomalySubscription | Subscribe to anomaly alerts |
| POST | /#X-Amz-Target=AWSInsightsIndexService.GetAnomalies | List detected anomalies |
| POST | /#X-Amz-Target=AWSInsightsIndexService.GetReservationUtilization | Reserved Instance utilisation |
| POST | /#X-Amz-Target=AWSInsightsIndexService.GetSavingsPlansUtilization | Savings Plans utilisation |

## Key resources

- **Cost and Usage Queries** — GetCostAndUsage and GetCostAndUsageWithResources for time-bucketed cost and usage.
- **Forecasts** — GetCostForecast and GetUsageForecast for forward-looking spend predictions.
- **Anomaly Monitors and Subscriptions** — Define monitors, subscribe alerts, and retrieve detected anomalies.
- **RI and Savings Plans** — Coverage, utilisation, and purchase recommendations for both commitment types.
- **Cost Categories** — Custom rollups across accounts and tags for executive reporting.
- **Rightsizing Recommendations** — EC2 instance-level recommendations based on observed utilisation.

## Why Jentic

- **Setup:** Wiring the AWS Cost Explorer Service by hand means holding an access key ID and secret access key, computing an AWS Signature Version 4 signature per request, targeting the fixed ce.us-east-1.amazonaws.com host with the right X-Amz-Target action header, and handling retries yourself. Through Jentic you install once, import the AWS Cost Explorer Service from the API Directory, store the AWS access key once, and your agent calls it.
- **Permission scoping:** Cost Explorer sends the query filters, groupings, and monitor identifiers in the request body rather than the URL path, so scope your agent by the operations it needs, such as getting cost and usage or fetching a cost forecast. You choose which operations it may call, so changes like creating an anomaly monitor or subscription are not included unless you add them.
- **Credential handling:** Your AWS access key ID and secret access key are stored once, encrypted, by your own Jentic One instance, and the Signature Version 4 signature is computed at execution time. The raw keys never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get AWS cost broken down by service' or 'forecast next month's spend', and Jentic returns the matching Cost Explorer operation with its input schema so the agent calls the right action without crawling the AWS reference.

## Related APIs

- **AWS Budgets** — Threshold-based budget alerts and automated enforcement actions on top of the same cost data.
- **AWS Cost and Usage Report** — Hourly line-item billing data delivered to S3 for custom BI when the API granularity is not enough.
- **AWS Savings Plans** — Manage Savings Plans purchases that change the cost shape Cost Explorer reports.

## FAQ

### What authentication does the AWS Cost Explorer API use?

All requests are signed with AWS Signature Version 4 using an AWS access key ID and secret access key. The endpoint is region-locked to us-east-1. Through Jentic, the credentials live encrypted in the vault and Jentic computes the signature server-side, so the agent only sees a scoped credential reference.

### Can I get cost broken down by tag with this API?

Yes. Pass GroupBy=[{Type: TAG, Key: <your-tag-key>}] to GetCostAndUsage. The tag must first be activated as a cost allocation tag in the Billing console; once activated, costs are grouped by tag value with one row per distinct tag value plus an unallocated row.

### What are the rate limits for the AWS Cost Explorer API?

Cost Explorer enforces a default of 5 requests per second per account, with bursts up to a small queue. High-volume reporting workloads should batch grouping into the largest practical query rather than fan out many small calls, and use exponential backoff on ThrottlingException.

### How do I forecast next month's AWS spend through Jentic?

Search Jentic for 'forecast AWS cost', load the GetCostForecast schema, and execute it with TimePeriod for the next month, Metric=UNBLENDED_COST, Granularity=MONTHLY, and PredictionIntervalLevel=95. The operation maps to GetCostForecast and returns the forecast plus the chosen confidence interval.

### How fresh is Cost Explorer data?

Most cost and usage data is updated at least once every 24 hours, with finalised data available the day after the billing period closes. Reserved Instance and Savings Plans coverage refreshes on the same daily cycle, so real-time spend tracking is not the right use case for this API. Use AWS Budgets for threshold alerts and CloudWatch metrics for near-real-time signals.

### Is AWS Cost Explorer free to use?

The Cost Explorer console UI is free; the Cost Explorer API charges $0.01 per paginated request. High-volume reporting (large daily backfills, granular tag breakdowns) should be designed to minimise the number of paged requests.

### Can I limit what my agent is allowed to do with the AWS Cost Explorer API?

Yes. Because you run Jentic One yourself, your own rules decide which Cost Explorer operations the agent may call and which AWS credentials it may use. Cost Explorer passes query filters, groupings, and monitor identifiers in the request body rather than the URL path, so you scope the agent by operation, for example allowing it to run GetCostAndUsage and GetCostForecast for read-only reporting. Write actions such as CreateAnomalyMonitor and CreateAnomalySubscription stay off limits unless you explicitly add them to the agent's allowed set.
