Importance Although prescription opioids are the most common way adolescents and young adults initiate opioid use, many studies examine population-level risks following the first opioid prescription. There is currently a lack of understanding regarding how patterns of opioid prescribing following the first opioid exposure may be associated with long-term risks. Objective To identify distinct patterns of opioid prescribing following the first prescription using group-based trajectory modeling and examine the patient-, clinician-, and prescription-level factors that may be associated with trajectory membership during the first year. Design, Setting, and Participants This cohort study examined Pennsylvania Medicaid enrollees' claims data from 2010 through 2016. Participants were aged 10 to 21 years at time of first opioid prescription. Data analysis was performed in March 2020. Main Outcomes and Measures This study used group-based trajectory modeling and defined trajectory status by opioid fill. Results Among the 189 477 youths who received an initial opioid prescription, 107 562 were female (56.8%), 81 915 were non-Latinx White (59.6%), and the median age was 16.9 (interquartile range [IQR], 14.6-18.8) years. During the subsequent year, 47 477 (25.1%) received at least one additional prescription. Among the models considered, the 2-group trajectory model had the best fit. Of those in the high-risk trajectory, 65.3% (n = 901) filled opioid prescriptions at month 12, in contrast to 13.1% (n = 6031) in the low-risk trajectory. Median age among the high-risk trajectory was 19.0 years (IQR, 17.1-20.0 years) compared with the low-risk trajectory (17.8 years [IQR, 15.8-19.4 years]). The high-risk trajectory received more potent prescriptions compared with the low-risk trajectory (median dosage of the index month for high-risk trajectory group: 10.0 MME/d [IQR, 5.0-21.2 MME/d] vs the low-risk trajectory group: 4.7 MME/d [IQR, 2.5-7.8 MME/d]; P