Doctors sometimes use caffeine as a medicine. It is used for headaches (head pain). It is sometimes used to help premature (born "very" early) babies to breathe. The short-term risk of this treatment seems to be that the babies treated gain less weight than usual.