ImportanceNo existing model allows clinicians to predict whether patients might return to opioid use in the early stages of treatment for opioid use disorder.ObjectiveTo develop an individual-level prediction tool for risk of return to use in opioid use disorder.Design, Setting, and ParticipantsThis decision analytical model used predictive modeling with individual-level data harmonized in June 1, 2019, to October 1, 2022, from 3 multicenter, pragmatic, randomized clinical trials of at least 12 weeks’ duration within the National Institute on Drug Abuse Clinical Trials Network (CTN) performed between 2006 and 2016. The clinical trials covered a variety of treatment settings, including federally licensed treatment sites, physician practices, and inpatient treatment facilities. All 3 trials enrolled adult participants older than 18 years, with broad pragmatic inclusion and few exclusion criteria except for major medical and unstable psychiatric comorbidities.InterventionAll participants received 1 of 3 medications for opioid use disorder: methadone, buprenorphine, or extended-release naltrexone.Main Outcomes and MeasuresPredictive models were developed for return to use, which was defined as 4 consecutive weeks of urine drug screen (UDS) results either missing or positive for nonprescribed opioids by week 12 of treatment.ResultsThe overall sample included 2199 trial participants (mean [SD] age, 35.3 [10.7] years; 728 women [33.1%] and 1471 men [66.9%]). The final model based on 4 predictors at treatment entry (heroin use days, morphine- and cocaine-positive UDS results, and heroin injection in the past 30 days) yielded an area under the receiver operating characteristic curve (AUROC) of 0.67 (95% CI, 0.62-0.71). Adding UDS in the first 3 treatment weeks improved model performance (AUROC, 0.82; 95% CI, 0.78-0.85). A simplified score (CTN-0094 OUD Return-to-Use Risk Score) provided good clinical risk stratification wherein patients with weekly opioid-negative UDS results in the 3 weeks after treatment initiation had a 13% risk of return to use compared with 85% for those with 3 weeks of opioid-positive or missing UDS results (AUROC, 0.80; 95% CI, 0.76-0.84).Conclusions and RelevanceThe prediction model described in this study may be a universal risk measure for return to opioid use by treatment week 3. Interventions to prevent return to regular use should focus on this critical early treatment period.