Find the machine's breaking point: the highest request rate that still meets the SLO.

Multiply that rate by 3,600. The result is the requests the machine serves in one hour.

Divide the hourly price by that number. The result is the cost of one request.

Multiply by one million. The result is US dollars per million requests.

Repeat for every candidate machine or code change. The lowest number wins.