Subanesthetic ketamine rapidly and robustly reduces depressive symptoms in patients with treatment-resistant depression. While it is commonly classified as an N-methyl D-aspartate receptor (NMDAR) antagonist, our picture of ketamine's mechanistic underpinnings is incomplete. Recent clinical evidence has indicated, controversially, that a component of the efficacy of ketamine in depression may be opioid dependent. Using pharmacological functional ultrasound imaging in rats, we found that blocking opioid receptors suppressed neurophysiologic changes evoked by ketamine, but not by a more selective NMDAR antagonist, in regions implicated in the pathophysiology of depression and in reward processing. Importantly, this opioid-dependent response was strongly sex dependent, as it was not evident in female subjects and was fully reversed by surgical removal of the male gonads. We observed similar opioid-mediated sex-dependent effects in ketamine-evoked structural plasticity and behavioral sensitization. Together, these results underscore the potential for ketamine to induce its affective responses via opioid signaling, and indicate that this opioid dependence may be strongly influenced by subject sex. These factors should be more directly assessed in future clinical trials.