The endogenous opioid system is thought to play a role in the placebo antidepressant response. A recent trial comparing the rapid antidepressant effects of ketamine versus placebo in surgical patients, some of whom were on chronic opioid therapy, revealed a substantial placebo effect. This finding provided an opportunity to test the hypothesis that opioid agonist exposure interacts with placebo antidepressant responses. This post hoc analysis utilized data from a previously reported randomized, anesthesia-blinded, placebo-controlled trial of intravenous ketamine in depressed patients undergoing routine surgery. Mixed-effects models were used to determine whether baseline opioid use influenced antidepressant responses to the trial interventions, as measured by the Montgomery-Åsberg Depression Rating Scale (MADRS) over 1 to 14 days post-treatment. The analysis showed that baseline opioid use significantly reduced post-treatment depression severity in patients who received placebo, but not in those who received ketamine. This reduction was independent of baseline depression severity, baseline pain intensity, and ethnicity. Additionally, there was negligible correlation between postoperative pain intensity and depression severity. This analysis was unregistered and conducted on a small sample; the findings need to be confirmed by prospective controlled studies. Opioid use at baseline attenuated the placebo antidepressant response independently of pain in depressed patients who received the study treatment under general anesthesia for routine surgery. The antidepressant response was preserved in opioid users who received intravenous ketamine.