This cohort study examines racial and ethnic disparities in retention in buprenorphine and methadone treatment among pregnant females with opioid use disorder (OUD) in the US.