Over the last few decades, opioid use disorder (OUD) and overdose have dramatically increased. Evidence shows that treatment for OUD, particularly medication for OUD, is highly effective; however, despite decreases in barriers to treatment, retention in OUD treatment remains a challenge. Therefore, understanding key risk factors for OUD treatment discontinuation remains a critical priority. We built a machine learning model using the Treatment Episode Data Set-Discharge (TEDS-D). Included were 2,446,710 treatment episodes for individuals in the U.S. discharged between January 1, 2015 and December 31, 2018 (the most recent available data). Exposures contain 32 potential risk factors, including treatment characteristics, substance use history, socioeconomic status, and demographic characteristics. Our findings show that the most influential risk factors include characteristics of treatment service setting, geographic region, primary source of payment, referral source, and health insurance status. Importantly, several factors previously reported as influential predictors, such as age, living situation, age of first substance use, race and ethnicity, and sex had far weaker predictive impacts. The influential factors identified in this study should be more closely explored to inform targeted interventions and improve future models of care.