To establish a prescription opioid registry protocol in a large health system and to describe algorithms to characterize individuals using prescription opioids, opioid use episodes, and concurrent use of sedative/hypnotics. Protocol development and retrospective cohort study. Using Kaiser Permanente Northern California (KPNC) electronic health record data, we selected patients using prescription opioids in 2011. Opioid and sedative/hypnotic fills, and physical and psychiatric comorbidity diagnoses, were extracted for years 2008 to 2014. Algorithms were developed to identify each patient’s daily opioid and sedative/hypnotic use, and morphine daily-dose equivalent. Opioid episodes were classified as long-term, episodic, or acute. Logistic regression was used to predict characteristics associated with becoming a long-term opioid user. In 2011, 18% of KPNC adult members filled at least 1 opioid prescription. Among those patients, 25% used opioids long term and their average duration of use was more than 4 years. Sedative/hypnotics were used by 76% of long-term users. Being older, white, living in a more deprived neighborhood, having a chronic pain diagnosis, and use of sedative/hypnotics were predictors of initiating long-term opioid use. This study established a population-based opioid registry that is flexible and can be used to address important questions of prescription opioid use. It will be used in future studies to answer a broad range of other critical public health issues relating to prescription opioid use.