There is growing evidence that opioid prescribing in the US follows a pattern in which patients who are at highest risk of adverse outcomes from opioids are most likely to receive long-term opioid therapy. These patients include, in particular, those with substance use disorders (SUDs) and other psychiatric conditions. This study examined health insurance claims among 10 311 961 patients who filled prescriptions for opioids. Specifically, we evaluated how opioid receipt differed among patients with and without a wide range of pre-existing psychiatric and behavioral conditions (i.e., opioid and non-opioid SUDs, suicide attempts or other self-injury, motor vehicle crashes, and depressive, anxiety, and sleep disorders) and psychoactive medications (i.e., antidepressants, benzodiazepines, hypnotics, mood stabilizers, antipsychotics, and medications used for SUD, tobacco cessation, and attention-deficit/hyperactivity disorder [ADHD]). Relative to those without, patients with all assessed psychiatric conditions and medications had modestly greater odds of subsequently filling prescriptions for opioids and, in particular, substantially greater risk of long-term opioid receipt. Increases in risk for long-term opioid receipt in adjusted Cox regressions ranged from approximately 1.5-fold for prior ADHD medication prescriptions (hazard ratio [HR] = 1.53; 95% CI, 1.48–1.58) to approximately 3-fold for prior non-opioid SUD diagnoses (HR = 3.15; 95% CI, 3.06–3.24) and nearly 9-fold for prior opioid use disorder diagnoses (HR = 8.70; 95% CI, 8.20–9.24). In sum, we found evidence of greater opioid receipt among commercially insured patients with a breadth of psychiatric conditions. Future studies assessing behavioral outcomes associated with opioid prescribing should consider pre-existing psychiatric conditions.