This used to be a thing; coin operated electricity, gas and steam meters were all common in big city tenements around the turn of the 20th century. Obviously this amounted to killing the poor by freezing them to death, something the very active socialist movements of the period and even most libs won't continence. Most cities therefore have minimum heating requirement laws, usually maintaining a certain temperature threshold with the windows open (for sanitation, since a lot of these laws date to the Spanish flu era). You'd be surprised how many protections tenants have in this respect, landlords just hope you don't research your local laws.
Ernest Poole wrote about this. His novel His Family is about a middle class West Village guy learning how much life sucks in the Upper East Side in 1917. Worth reading just for all the "get off my lawn" rants about how automobiles have ruined the soundscape of the city.