DPU cost from the billing page



Is there any way to get the accurate DPU cost usage from the billing page via an API? I know datasift right now has a Usage REST API? How do we process this so that we get the accurate DPU cost matching the one in the bililing page? Or do we have any other API we can call?


You can call the /dpu REST API endpoint with a stream hash to return the DPU cost for that stream. 


Thanks for the response Jason.
The /dpu REST API as you mentioned provide DPU cost per stream. I’m looking for something like the billing page , where we can display the DPU usage cost (in dollar), per day. Is there any REST API endpoint we can call to get that information?


You can use the /dpu endpoint in conjunction with the /usage endpoint to achieve this. The DPU cost of a stream is the cost of running that stream for a full hour, and a single DPU is charged at $0.20 on the Pay-As-You-Go plan. The /usage endpoint will show you how long you have consumed each of your individual streams for (in seconds).

So, If I have consumed a 2.5 DPU stream, for 24 hours, the total cost of consuming that stream will be:

2.5 (DPUs) x 24 (hours) x $0.20 = $12


Thanks Jason, I also understand we also need to take into account the rounding of 1 DPU per hour minimum. So it seems the best way would be to call the usage API per hour and update the DPU usage per hour.