PURPOSE Recent results suggests the risk of a new onset of depression increases with longer duration of opioid analgesic use. It is unclear whether new-onset depression related to opioid analgesic use is a function of the dose prescribed or the duration of use or both. METHODS Using a retrospective cohort design, we collected patient data from 2000 to 2012 from the Veterans Health Administration (VHA), and from 2003 to 2012 from both Baylor Scott & White Health (BSWH) and the Henry Ford Health System (HFHS). Patients (70,997 VHA patients, 13,777 BSWH patients, and 22,981 HFHS patients) were new opioid users, aged 18 to 80 years, without a diagnosis of depression at baseline. Opioid analgesic use duration was defined as 1 to 30, 31 to 90, and more than 90 days, and morphine equivalent dose (MED) was defined as 1 to 50 mg/d, 51 to 100 mg/d, and greater than 100 mg/d of analgesic. Pain and other potential confounders were controlled for by inverse probability of treatment–weighted propensity scores. RESULTS New-onset depression after opioid analgesic use occurred in 12% of the VHA sample, 9% of the BSWH sample, and 11% of the HFHS sample. Compared with 1- to 30-day users, new-onset depression increased in those with longer opioid analgesic use. Risk of new-onset depression with 31 to 90 days of opioid analgesic use ranged from hazard ratio [HR] = 1.18 (95% CI, 1.10-1.25) in VHA to HR = 1.33 (95% CI, 1.16-1.52) in HFHS; in opioid analgesic use of more than 90 days, it ranged from HR = 1.35 (95% CI, 1.26-1.44) in VHA to HR = 2.05 (95% CI, 1.75-2.40) in HFHS. Dose was not significantly associated with a new onset of depression. CONCLUSIONS Opioid-related new onset of depression is associated with longer duration of use but not dose. Patients and practitioners should be aware that opioid analgesic use of longer than 30 days imposes risk of new-onset depression. Opioid analgesic use, not just pain, should be considered a potential source when patients report depressed mood.