We develop a method to determine redox levels of half reactions through the use of ab initio molecular dynamics evolving at constant Fermi energy. This scheme models the effect of an electrode by controlling the charge transfer between the single-particle energy levels of the system and an electron reservoir set at a given potential during the dynamics. Like the thermodynamic integration method, our scheme does not require a priori knowledge of the products of the reaction, which can simply be obtained by driving the reaction through the variation of the Fermi level. The simulations are performed subject to periodic boundary conditions in the absence of any counterelectrode. We extract the redox level from the evolution of the Kohn-Sham energies upon charging (or discharging) the system. Using Janak's theorem and assuming a quadratic evolution of the Kohn-Sham energy of the highest occupied state upon charging, we demonstrate that our scheme for the determination of redox levels is equivalent to the thermodynamic integration method. The approach is illustrated for the redox couples Fe2+/Fe3+, HO2 center dot/HO2-, and MnO4-/MnO4-2 in aqueous solution and yields redox potentials differing by less than 0.1 eV from respective ones achieved with the thermodynamic integration method.