Some prescription and over-the-counter medications have caffeine. Most commonly, medications for coughs and colds, headaches and some slimming medications have caffeine. Its best to speak to your doctor or pharmacist before taking any medication or supplements while pregnant or breastfeeding.