Opioids are important tools for pain management, but abuse can result in serious health complications. Of these complications, respiratory depression that leads to brain hypoxia is the most dangerous, resulting in coma and death. Although all opioids at large doses induce brain hypoxia, danger is magnified with synthetic opioids such as fentanyl and structurally similar analogs. These drugs are highly potent, act rapidly, and are often not effectively treated by naloxone, the standard of care for opioid-induced respiratory depression. The goal of this review paper is to present and discuss brain oxygen responses induced by opioids, focusing on heroin and fentanyl. In contrast to studying drug-induced changes in respiratory activity, we used chronically implanted oxygen sensors coupled with high-speed amperometry to directly evaluate physiological and drug-induced fluctuations in brain oxygen levels in awake, freely moving rats. First, we provide an overview of brain oxygen responses to physiological stimuli and discuss the mechanisms regulating oxygen entry into brain tissue. Next, we present data on brain oxygen responses induced by heroin and fentanyl and review underlying mechanisms. These data allowed us to compare the effects of these drugs on brain oxygen in terms of their potency, time-dependent response pattern, and potentially lethal effect at high doses. Then, we present the interactive effects of opioids during polysubstance use (alcohol, ketamine, xylazine) on brain oxygenation. Finally, we consider factors that affect the therapeutic potential of naloxone, focusing on dosage, timing of drug delivery, and contamination of opioids by other neuroactive drugs. The latter issue is considered chiefly with respect to xylazine, which strongly potentiates the hypoxic effects of heroin and fentanyl. Although this work was done in rats, the data are human relevant and will aid in addressing the alarming rise in lethality associated with opioid misuse.