Inclusion Criteria:
* Age 18 to 75 years.
* Body mass index (BMI) \> 18.
* Able and willing to provide informed consent prior to any study-related activities.
* Current diagnosis of Diagnostic and Statistical Manual Diploma in Social Medicine (DSM)-5 Opioid Use Disorder (OUD) as per the Mini International Neuropsychiatric Interview (MINI) or per the site clinic diagnosis. Patients are eligible if they have a MINI \> 3 ("moderate" or "severe" in the "Specify If" box in the Substance Use Disorder (Non-Alcohol) module for the category of opiates).
* Currently receiving outpatient treatment for OUD and at least 2 weeks on buprenorphine (BUP) or 4 weeks on methadone at the study site and/or at an associated clinic at the time of enrollment.
* Have at least 1 urine test positive for opioids after 2 weeks on BUP or 4 weeks on methadone.
* Have positive self-reporting of opioid use after 2 weeks on BUP or 4 weeks on methadone.
* If anatomically capable of becoming pregnant and of childbearing age, is not pregnant (confirmed) or breastfeeding at the time of enrollment and agrees to use a medically accepted method of birth control or to abstain from sexual intercourse while in the study.
* Able to read and communicate in English to the level required to accept standard care and complete all study requirements.
* Able and willing to engage/adhere to the entirety of the study protocol (19 weeks).
* Not currently a prisoner.
Exclusion Criteria:
* Age \< 18 or \> 75 years.
* BMI \<18.
* Individuals who are pregnant, planning pregnancy, breastfeeding, or unwilling to use adequate contraceptive measures.
* Current use of glucagon-like peptide 1 receptor (GLP-1R) agonist.
* History of angioedema, serious hypersensitivity reaction, or anaphylactic reaction to semaglutide or another GLP-1R agonist.
* Personal or family history of medullary thyroid carcinoma (MTC) or patients with multiple endocrine neoplasia syndrome Type 2 (MEN 2) or thyroid nodule.
* Type 1 diabetes or history of diabetic ketoacidosis.
* Type 2 diabetes mellitus or current use of a dipeptidyl peptidase-4 (DPP-4) inhibitor.
* Past 30-day use of Sincalide, Sulfonylureas, insulin and insulin products or other medications that may interact with semaglutide.
* Hypoglycemia on intake visit (blood glucose \< 60 mg/dL).
* End-stage renal failure, on dialysis, or glomerular filtration rate (GFR) \<30 mL/min per 1.73 square meters or previous renal transplant.
* End stage liver disease or previous liver transplant.
* Current or past diagnosis of pancreatitis, gastroparesis, or other severe gastrointestinal (GI) disease.
* Current or past diagnosis of gallbladder disease or gallstones.
* Serious cardiovascular disease within the past 6 months (e.g. uncontrolled hypertension, heart failure, significant cardiac arrhythmias, myocardial infarction, presence of angina pectoris, symptomatic coronary artery disease, deep vein thrombosis, pulmonary embolism, second- or third-degree heart block, mitral valve or aortic stenosis, hypertrophic cardiomyopathy, stroke).
* Severe co-occurring psychiatric disorder (e.g., bipolar disorder, psychotic disorder, schizophrenia), and/or history or evidence of organic brain disease or dementia that would compromise safety or compliance with the study protocol in the opinion of the site principal investigator (PI) and/or physician. As there is no specific scale that determines this, this will include the Site PI/physician determining if the potential participant shows consistency in decision making and if they are alert and oriented to time, date, day and location.
* Significant risk of suicide requiring a different/higher level of care, according to the clinical judgment of the study physician or site principal investigator, or history of suicide attempts within the past 1 year, unless participation is cleared by clinician assessment and/or judgment. A Columbia-Suicide Severity Rating Scale (C-SSRS) indicating a history of suicide attempts within the past year, or active suicidal ideation within the past 1 month, will qualify as significant risk of suicide.
* Treatment with any investigational drug in the one month preceding the study.
* Any contraindication to both methadone and BUP.
* Any contraindication to a GLP-1R agonist.
* Previous randomization for participation in this trial.
* Any other condition at screening that precludes safe participation in the trial in the judgment of the site PI or study physician.
* Plans for travel outside of the local area over the 19 weeks (1 week of baseline, 12 weeks of medication, 1 week wash-out, and follow-up after a further 28 days) that would interfere with visits during the study period or other logistic factors that would make it difficult to commit to the entire duration of study.
* Currently a prisoner.