Loading...
Loading...
This skill should be used when users need to query AWS cost and usage details for a specific date. It supports querying costs at service level (e.g., EC2, S3, RDS) and drilling down to usage type level (e.g., instance types, storage classes, data transfer). Triggers on requests mentioning AWS costs, billing, spending, cost breakdown, or fee analysis.
npx skill4agent add oldwinter/skills aws-cost-explorerscripts/cost_query.py# Query costs from 2 days ago (default) by service
python3 <skill-path>/scripts/cost_query.py
# Query yesterday's costs, show items > $5
python3 <skill-path>/scripts/cost_query.py --days-ago 1 --min-cost 5
# Query specific date
python3 <skill-path>/scripts/cost_query.py --date 2026-01-15
# Query specific service's usage breakdown
python3 <skill-path>/scripts/cost_query.py --service "Amazon OpenSearch Service" --min-cost 1
# Query all services with usage type details
python3 <skill-path>/scripts/cost_query.py --detailed --min-cost 5
# Output as JSON
python3 <skill-path>/scripts/cost_query.py --json --min-cost 5| Option | Short | Description |
|---|---|---|
| | Query N days ago (default: 2, i.e., day before yesterday) |
| Query specific date (YYYY-MM-DD format) | |
| | Minimum cost threshold to display (default: 0) |
| | Query usage type breakdown for a specific service |
| Show all services with usage type breakdown | |
| | Output in JSON format |
--service| Common Name | AWS Service Name |
|---|---|
| OpenSearch | |
| DocumentDB/MongoDB | |
| EC2 Compute | |
| EC2 Other (EBS, NAT) | |
| EFS | |
| S3 | |
| RDS | |
| EKS | |
| VPC | |
| Bedrock | |
| Lambda | |
| CloudWatch | |
| Pattern | Meaning |
|---|---|
| EC2 instance hours (e.g., |
| OpenSearch instance hours |
| EBS storage (e.g., |
| S3/EFS storage capacity |
| Data transfer costs |
| NAT Gateway costs |
| VPC Endpoint costs |
| Bedrock token usage |
| DocumentDB Elastic costs |
ce:GetCostAndUsagepython3 <skill-path>/scripts/cost_query.py --min-cost 5python3 <skill-path>/scripts/cost_query.py --service "Amazon OpenSearch Service" --min-cost 1python3 <skill-path>/scripts/cost_query.py --detailed --min-cost 5