ImportanceRising drug costs contribute to medication nonadherence and adverse health outcomes. Real-time prescription benefit (RTPB) systems present prescribers with patient-specific out-of-pocket cost estimates and recommend lower-cost, clinically appropriate alternatives at the point of prescribing.ObjectiveTo investigate whether RTPB recommendations lead to reduced patient out-of-pocket costs for medications.Design, Setting, and ParticipantsIn this cluster randomized trial, medical practices in a large, urban academic health system were randomly assigned to RTPB recommendations from January 13 to July 31, 2021. Participants were adult patients receiving outpatient prescriptions during the study period. The analysis was limited to prescriptions for which RTPB could recommend an available alternative. Electronic health record data were used to analyze the intervention’s effects on prescribing. Data analyses were performed from August 20, 2021, to June 8, 2022.InterventionsWhen a prescription was initiated in the electronic health record, the RTPB system recommended available lower-cost, clinically appropriate alternatives for a different medication, length of prescription, and/or choice of pharmacy. The prescriber could select either the initiated order or one of the recommended options.Main Outcomes and MeasuresPatient out-of-pocket cost for a prescription. Secondary outcomes were whether a mail-order prescription and a 90-day supply were ordered.ResultsOf 867 757 outpatient prescriptions at randomized practices, 36 419 (4.2%) met the inclusion criteria of having an available alternative. Out-of-pocket costs were $39.90 for a 30-day supply in the intervention group and $67.80 for a 30-day supply in the control group. The intervention led to an adjusted 11.2%; (95% CI, −15.7% to −6.4%) reduction in out-of-pocket costs. Mail-order pharmacy use was 9.6% and 7.6% in the intervention and control groups, respectively (adjusted 1.9 percentage point increase; 95% CI, 0.9 to 3.0). Rates of 90-day supply were not different. In high-cost drug classes, the intervention reduced out-of-pocket costs by 38.9%; 95% CI, −47.6% to −28.7%.Conclusions and RelevanceThis cluster randomized clinical trial showed that RTPB recommendations led to lower patient out-of-pocket costs, with the largest savings occurring for high-cost medications. However, RTPB recommendations were made for only a small percentage of prescriptions.Trial RegistrationClinicalTrials.gov Identifier: NCT04940988; American Economic Association Registry: AEARCTR-0006909