The origin and shape of metabolic scaling has been controversial since Kleiber found that basal metabolic rate of animals seemed to vary as a power law of their body mass with exponent 3/4, instead of 2/3, as a surface-to-volume argument predicts. The universality of exponent 3/4 -claimed in terms of the fractal properties of the nutrient network- has recently been challenged according to empirical evidence that observed a wealth of robust exponents deviating from 3/4. Here we present a conceptually simple thermodynamic framework, where the dependence of metabolic rate with body mass emerges from a trade-off between the energy dissipated as heat and the energy efficiently used by the organism to maintain its metabolism. This balance tunes the shape of an additive model from which different effective scalings can be recovered as particular cases, thereby reconciling previously inconsistent empirical evidence in mammals, birds, insects and even plants under a unified framework. This model is biologically motivated, fits remarkably well the data, and also explains additional features such as the relation between energy lost as heat and mass, the role and influence of different climatic environments or the difference found between endotherms and ectotherms.