Hi Elastic Community,
I'm trying to understand how the Billing Endpoint works in Elastic Cloud. Specifically, I'm using the /costs/<ORG_ID>/items endpoint to retrieve cost data, but the totals I'm getting from the API do not match the costs displayed in my Elastic Cloud Console.
I've ensured I'm querying the API for the same time range as displayed in the console.
I've referred to the documentation here: Elastic Cloud Billing Costs Analysis, but I'm still unclear on a few things:
- Why might there be a discrepancy between the totals from the API and the console?
- Are there any hidden costs that are not reflected in the
billing
API? - Are there other endpoints I need to query to get the complete or correct total cost?
- How should I aggregate the data to match the totals shown in the Elastic Cloud Console?
Here is the response from the following curl request:
curl -XGET https://api.elastic-cloud.com/api/v1/billing/costs/ORG_ID/items -H "Authorization: ApiKey API_TOKEN
"costs": {
"total": 2.2557,
"dimensions": [
{
"cost": 2.2269,
"type": "capacity"
},
{
"cost": 0.0,
"type": "data_in"
},
{
"cost": 0.0283,
"type": "data_internode"
},
{
"cost": 0.0005,
"type": "data_out"
},
{
"cost": 0.0,
"type": "storage_api"
},
{
"cost": 0.0,
"type": "storage_bytes"
}
]
},
"resources": [...]
"data_transfer_and_storage": [...]
Here's the billing detail for test deployments in our console:
I've tried adjusting the query parameters to specify a time range, and am still not able to get accurate data.
We'd like to better understand what costs the specified API is returning and if we're missing any endpoints.
Thanks in advance for your help, it's greatly appreciated!