2026/11/19 - AWS Billing and Cost Management Pricing Calculator - 1 new api methods
Changes Adding new API, GetUsageLinesEstimatedCost which can be used to estimate the cost of usage lines.
Retrieves the estimated cost of a list of usage lines. Each usage line identifies a billing line by its service code, usage type, and operation, and includes the usage amount to price. The estimate is based on Amazon Web Services pricing data and the rate type you choose. It doesn't include taxes, and your actual charges depend on your usage.
The response includes the estimated cost of each usage line that was priced. It also includes each usage line that couldn't be priced, and the reason it couldn't be priced.
See also: AWS API Documentation
Request Syntax
client.get_usage_lines_estimated_cost(
usage=[
{
'serviceCode': 'string',
'usageType': 'string',
'operation': 'string',
'key': 'string',
'amount': 123.0
},
],
rateType='BEFORE_DISCOUNTS'|'AFTER_DISCOUNTS'|'AFTER_DISCOUNTS_AND_COMMITMENTS'
)
list
[REQUIRED]
The usage lines that you want to estimate. You can include up to 500 usage lines in a request.
(dict) --
Represents a usage line that you want to estimate.
serviceCode (string) -- [REQUIRED]
The Amazon Web Services service code of the usage line, for example AmazonEC2.
usageType (string) -- [REQUIRED]
The usage type of the usage line, for example BoxUsage:t3.micro.
operation (string) -- [REQUIRED]
The operation of the usage line, for example RunInstances.
key (string) -- [REQUIRED]
A unique identifier for the usage line in the request. Use the key to match the usage line with its result in lineItems or errors in the response.
amount (float) -- [REQUIRED]
The usage amount to price for the usage line in the usage type's pricing unit. This value must be 0 or greater.
string
[REQUIRED]
The type of pricing rates to use to estimate the cost of the usage lines. You can only use a rate type that your Pricing Calculator rate preferences allow. If you use billing transfer as a bill source account, you can only use BEFORE_DISCOUNTS
dict
Response Syntax
{
'rateType': 'BEFORE_DISCOUNTS'|'AFTER_DISCOUNTS'|'AFTER_DISCOUNTS_AND_COMMITMENTS',
'totalCost': 123.0,
'currency': 'USD',
'lineItems': [
{
'key': 'string',
'serviceCode': 'string',
'usageType': 'string',
'operation': 'string',
'estimatedCost': {
'usageAmount': 123.0,
'usageUnit': 'string',
'cost': 123.0,
'currency': 'USD'
}
},
],
'errors': [
{
'key': 'string',
'serviceCode': 'string',
'usageType': 'string',
'operation': 'string',
'errorCode': 'BAD_REQUEST'|'NOT_FOUND'|'CONFLICT'|'INTERNAL_SERVER_ERROR',
'errorMessage': 'string'
},
]
}
Response Structure
(dict) --
rateType (string) --
The type of pricing rates used to estimate the cost of the usage lines.
totalCost (float) --
The sum of the estimated costs of all usage lines that were priced. Usage lines returned in errors aren't included.
currency (string) --
The currency of the costs in the response.
lineItems (list) --
The estimated cost of each usage line that was priced.
(dict) --
Represents the estimated cost of a usage line that was priced.
key (string) --
The key of the usage line in the request.
serviceCode (string) --
The Amazon Web Services service code of the usage line.
usageType (string) --
The usage type of the usage line.
operation (string) --
The operation of the usage line.
estimatedCost (dict) --
The estimated cost of the usage amount in the request.
usageAmount (float) --
The usage amount that was priced.
usageUnit (string) --
The unit of the usage amount, for example Hrs or GB-Mo.
cost (float) --
The estimated cost for the given usage amount.
currency (string) --
The currency of the estimated cost.
errors (list) --
The usage lines that couldn't be priced, and the reason that each one couldn't be priced.
(dict) --
Represents a usage line that couldn't be priced.
key (string) --
The key of the usage line in the request that couldn't be priced.
serviceCode (string) --
The Amazon Web Services service code of the usage line that couldn't be priced.
usageType (string) --
The usage type of the usage line that couldn't be priced.
operation (string) --
The operation of the usage line that couldn't be priced.
errorCode (string) --
The code associated with the error.
errorMessage (string) --
The message that describes the error.