Inclusion Criteria:
* Adults (all genders) 22 to 75 years old.
* Current diagnosis of severe primary opioid use disorder (OUD) (\>= 6 on DSM-5 OUD criteria) (any form of opioid use).
* History of opioid use for more than 5 years.
* Participants are seeking treatment for their OUD.
* Participants have insight into their opioid use disorder (score \> 26 on the recognition subscale of the Stages of Change Readiness and Treatment Eagerness Scale (SOCRATES V.8))
* OUD is treatment refractory: unable to achieve sustained remission over the past 5 years, despite at least three treatment attempts (outpatient, residential, inpatient), with at least one treatment attempt involving taking a first-line medication for OUD (MOUD) such as buprenorphine, methadone, or extended-release naltrexone. Treatment failure is defined as continued opioid use or relapse during or after completion of treatment. Sustained remission is defined per DSM-5 as not meeting any OUD criteria except craving for \> 12 months. Documented adherence: participants must have documented adherence to the failed first-line MOUD for at least 8 weeks (PMID: 29083570).
* Stated willingness to comply with all study procedures and availability for the duration of the study.
* Social support system and stable living arrangement to provide assurances that the subject will adhere to study requirements: family or friends who live with or near the subject, and can provide collateral information, monitor the subject's behavior, support, and encourage the subject to participate in follow-up visits and evaluations.
* For individuals of reproductive potential: use of highly effective contraception for at least 4 weeks prior to sEEG surgery and agreement to use such a method during study participation.
Exclusion Criteria:
* Pregnancy or lactation.
* Non-English speaking.
* Participants are not willing to start MOUD treatment with buprenorphine or to switch MOUD to buprenorphine if they are already on other MOUD, for the duration of the study.
* OUD treatment with another investigational drug or other intervention within 3 months.
* History of primary psychosis or Bipolar I disorder per the medical interview.
* History of severe personality disorder that could interfere with study participation (e.g., antisocial personality disorder) per the medical interview.
* History of traumatic brain injury with loss of consciousness greater than 5 minutes.
* Clinically significant cognitive impairment per neuropsychological testing.
* History of suicidal attempts in the past 3 years or current suicidal thoughts per psychiatric evaluation.
* Coagulopathy: INR \> 1.4, aPTT \> 40 s, platelets \< 100,000.
* Current clinically significant medical or neurologic disease that affects brain function (e.g., recent stroke, myocardial infarction, seizures not due to alcohol withdrawal).
* Clinically significant abnormality on structural brain MRI scan.
* Life expectancy less than 24 months per the clinical judgment of study investigators (e.g., terminal cancers).
* Any labeled DBS contraindication or inability to have brain MRI: certain pacemakers, metal in body, inability to undergo awake operation, significant cardiac or other medical risk factors for surgery, infection, and coagulopathy.
* Exclusion for early remission: participants who achieve early remission after initiating buprenorphine during the screening phase (prior to the sEEG phase) will be excluded from the study.