This paper presents thermodynamic optimization of an endoreversible air heat pump with variable-temperature heat reservoirs and hot- and cold-side counter-flow heat exchangers. The expressions of the heating load, the exergetic efficiency and the ecological function of the heat pump cycle are derived. Performance comparisons among exergetic efficiency optimization objective, ecological optimization objective and traditional heating load optimization objective are performed. The influences of the pressure ratio of the compressor, the allocation of heat exchanger inventory and the heat capacity rate matching between the working fluid and the heat reservoirs on the optimal performance of the cycle are investigated by detailed numerical examples. When the performance optimization of the cycle is carried out by selecting the pressure ratio, three optimization objectives give different results; however, the results of three optimization objectives are consistent by optimizing the allocation of heat exchanger inventory and optimizing the heat capacity rate matching between the working fluid and the heat reservoirs. The results may provide guidelines for the design and optimization of practical air heat pump plants. Copyright The Author 2009. Published by Oxford University Press. All rights reserved. For Permissions, please email: journals.permissions@oxfordjournals.org, Oxford University Press.