LHAASO-KM2A can precisely measure the shower sizes of both electromagnetic particles and the muon content in cosmic-ray air showers. In this study, we present a method for estimating the energy of primary cosmic rays over a broad zenith angle range \( (0^\circ \text{-} 38^\circ) \) with a consistent correction for the zenith angle. This wide zenith angle range enhances cosmic ray measurement statistics by increasing the number of detected events. We report the bias and energy resolutions of our technique above 1 PeV, with the energy resolution better than 15% and the bias constrained within 6%. The all-particle energy spectrum derived using this method was aligned with the expected energy spectrum. We further assessed the systematic uncertainties arising from high-energy hadronic interaction models, such as QGSJETII-04, EPOS-LHC, and SIBYLL-2.3d, on our energy estimation, covering energies from 1 PeV upward. This approach improves the high-energy spectrum reconstruction, primarily owing to the enhanced event statistics enabled by zenith angle corrections.

