Inclusion Criteria:  ≥18 years old American Society of Anesthesiologists physical status 1-4 Scheduled for major noncardiac surgery expected to last at least 2 hours Expected to remain hospitalized at least two postoperative nights Scheduled for general endotracheal, spinal anesthesia, or the combination Expected to require substantial opioid analgesia, defined as ≥20 mg morphine equivalents Expected to have patient-controlled intravenous analgesia.  Exclusion Criteria:  Are demented or otherwise cannot provide valid consent Have contraindications to oliceridine Used legal or illegal opioids chronically, defined as >15 mg morphine equivalents for >15 days during the month before consenting by history Have language, vision, or hearing impairments that may compromise continuous ventilation monitoring Have planned epidural anesthesia/analgesia Planned spinal morphine administration Are designated Do Not Resuscitate, hospice, or receiving end of life therapy Are expected to require postoperative mechanical ventilation or ICU admission Are expected to receive intrathecal opioids Are expected to receive gabapentin, pregabalin or other analgesic adjuvants Use oxygen at home Are unwilling or unable to comply fully with study procedures (including not tolerating the capnography cannula) Are known to be pregnant or breastfeeding Use CPAP at home Have previously participated in the trial