Abstract Background Hydrocodone, the most commonly prescribed opioid in the U.S., is typically used for pain management following surgery and is a known potential drug of abuse with non-negligible risk of addiction. Significant variability in patients’ response to hydrocodone therapy have been reported, owing to both iatrogenic and endogenous sources. The objective of this study is to evaluate the feasibility of predicting post-discharge hydrocodone use in patients who have undergone orthopedic surgery using patient demographics, genotyping, concurrently prescribed medications, and routinely collected laboratory test results. Methods Targeted genotyping was performed on each patient with genes known to affect hydrocodone pharmacokinetics or pharmacodynamics, including CYP2D6, CYP3A4, CYP3A5, CYP2B6, COMT, OPRM1, and ABCB1. An inhibition index for CYP2D6 was calculated by ranking concurrently prescribed medications as weak, moderate, or strong inhibitors of enzyme activity. Pain index, average hydrocodone dose per day during hospital stay, and CYP2D6 estimated activity scores based on allele functionality were included as predictors. In addition, a retrospective chart review of electronic hospital records was performed where basic metabolic panel and complete blood count results were screened within 10 days of each patient's surgery date. Two types of classification and decision tree algorithms were tuned and validated as prediction models using 5-fold cross validation, including a ‘Fast and Frugal Decision Tree’ (FFTree) and an extreme gradient boosting machine (xgBoost). Clinical predictive features were ranked according to the Shapley Additive Explanations (SHAP) values using the xgBoost model. Results Out of 79 total patients with hydrocodone use duration information, 25 were categorized as “Short” and 54 categorized as “Long” using a 1-week threshold. FFTree model selected the top three features of CYP2D6 inhibition index, blood sodium level, and blood creatinine level and obtained a sensitivity and specificity of 0.80 and 0.76, respectively. The xgBoost model, using the same three features, achieved a sensitivity and specificity of 0.872 and 0.628, respectively, an AUROC of 0.814, PRAUC of 0.912, net benefit of 0.359, and was well-calibrated with a Brier score of 0.161. Consistent with previously published results, the predictive capacity of all genotypes analyzed were unremarkable and consistently ranked as the least important features by the xgBoost model SHAP values, due to their low predictive value. Conclusions Both the FFTree and xgBoost models were able to adequately classify the patients according to a 1-week stratification criteria with good to excellent classification performance. Patients with larger CYP2D6 inhibition index were more likely to be classified as “Long” duration. Sodium and creatinine level, which may reflect hydration status and renal function, and therefore hydromorphone elimination rate, were key predictors of post-discharge hydrocodone use duration when combined with the CYP2D6 inhibition index. Further refinement of the proposed models and validation of model robustness and stability using external cohorts is necessary. These results may have implications for providers when prescribing hydrocodone for pain management, where the ability to risk-stratify patients according to their predicted probability of developing opioid use disorder is of clinical importance.