In this work we estimate the heavy quark production in the interaction of ultra high energy cosmic rays in the atmosphere, considering that the primary cosmic ray is a proton or a photon. At these energies the saturation momentum Q 2 sat (x) stays above the hard scale µ 2 c = 4m 2 c , implying charm production probing the saturation regime. In particular, we show that the ep HERA data presents a scaling on τ c ≡ (Q 2 + µ 2 c )/Q 2 sat (x). We derive our results considering the dipole picture and the Color Glass Condensate formalism, which one shows to be able to describe the heavy quark production in γp and pp collisions. Nuclear effects are considered for the scattering of primaries with the air nuclei and we provide a parametrization for the charm and bottom differential cross sections, dσ/dx F , which can be used as an input for numerical implementations for lepton flux. Implications on the flux of prompt leptons at the Earth are analyzed and a large suppression is predicted.