ABSTRACT: Importance:Although opioids can be effective medications in certain situations, they are associated with harms, including opioid use disorder and overdose. Studies have revealed unexplained prescribing variation and prescribing mismatched with patient-reported pain for many indications. Objective:To summarize opioid prescribing frequency, dosages, and durations, stratified across numerous painful medical indications. Design, Setting, and Participants:Retrospective cross-sectional analysis of 2017 US administrative claims data among outpatient clinical settings, including postsurgical discharge. Participants had any of 41 different indications associated with nonsurgical acute or chronic pain or postsurgical pain or pain associated with sickle cell disease or active cancer and were enrolled in either private insurance (including Medicare Advantage) in the OptumLabs Data Warehouse data set (n?=?18?016?259) or Medicaid in the IBM MarketScan Multi-State Medicaid Database (n?=?11?453?392). OptumLabs data were analyzed from October 2018 to March 2019; MarketScan data were analyzed from January to April 2019. Exposures:Nonsurgical acute or chronic pain or postsurgical pain; pain related to sickle cell disease or active cancer. Main Outcomes and Measures:Indication-specific opioid prescribing rates; days' supply per prescription; daily opioid dosage in morphine milligram equivalents; and for chronic pain indications, the number of opioid prescriptions. Results:During the study period, of 18?016?259 eligible patients with private insurance, the mean (95% CI) age was 42.7 (42.7-42.7) years, and 50.3% were female; of 11?453?392 eligible Medicaid enrollees, the mean (95% CI) age was 20.4 (20.4-20.4) years, and 56.1% were female. A pain-related indication under study occurred in at least 1 visit among 6?380?694 patients with private insurance (35.4%) and 3?169?831 Medicaid enrollees (27.7%); 2?270?596 (35.6% of 6?380?694) privately insured patients and 1?126?508 (35.5% of 3?169?831) Medicaid enrollees had 1 or more opioid prescriptions. Nonsurgical acute pain opioid prescribing rates were lowest for acute migraines (privately insured, 4.6% of visits; Medicaid, 6.6%) and highest for rib fractures (privately insured, 44.8% of visits; Medicaid, 56.3%), with variable days' supply but similar daily dosage across most indications. Opioid prescribing for a given chronic pain indication varied depending on a patient's opioid use history. Days' supply for postoperative prescriptions was longest for combined spinal decompression and fusion (privately insured, 9.5 days [95% CI, 9.4-9.7 days]) or spinal fusion (Medicaid, 9.1 days [95% CI, 8.9-9.2 days]) and was shortest for vaginal delivery (privately insured, 4.1 days [95% CI, 4.1-4.1 days] vs Medicaid, 4.2 days [95% CI, 4.2-4.2 days]). Conclusions and Relevance:Indication-specific opioid prescribing rates were not always aligned with existing guidelines. Potential inconsistencies between prescribing practice and clinical recommendations, such as for acute and chronic back pain, highlight opportunities to enhance pain management and patient safety.