In this work, we advanced an efficient free energy sampling method based on constrained ab initio molecular dynamics (cAIMD) with a fully explicit solvent layer to depict the electrochemical reaction process at constant surface charge density, named the "Constant-Potential Thermodynamic Integration (CPTI)" method. For automatically adjusting surface charge density at different states, we built an "on-the-fly" procedure which is capable of managing all the necessary steps during cAIMD simulations, including the system pre-equilibrium, surface charge density updating, and force sampling. We applied it to predict the potentialdependent free energy profiles of CO 2 adsorption on a single-atom catalyst. The results show that our method can not only account for changes in electrostatic potential energy associated with potential but also consider the potential-induced solvation effects. Our approach enables the accurate simulation of electrochemical environment by presenting the complete solid−liquid interface and efficient computation of electrocatalytic reaction energetics based on a robust potential descriptor.