Your healthcare provider may prescribe CPAP to treat sleep-related breathing disorders including sleep apnea. CPAP also may treat preterm infants who have underdeveloped lungs.BiPAP machines are also sometimes prescribed to people who have sleep apnea as well as severe obesity or certain other health conditions, like chronic obstructive pulmonary d