Objective Contrast agents used for radiological examinations are an important cause of acute kidney injury (AKI). We developed and validated a machine learning and clinical scoring prediction model to stratify the risk of contrast-induced nephropathy, considering the limitations of current classical and machine learning models. Methods This retrospective study included 38,481 percutaneous coronary intervention cases from 23,703 patients in a tertiary hospital. We divided the cases into development and internal test sets (8:2). Using the development set, we trained a gradient boosting machine prediction model (complex model). We then developed a simple model using seven variables based on variable importance. We validated the performance of the models using an internal test set and tested them externally in two other hospitals. Results The complex model had the best area under the receiver operating characteristic (AUROC) curve at 0.885 [95% confidence interval (CI) 0.876-0.894] in the internal test set and 0.837 (95% CI 0.819-0.854) and 0.850 (95% CI 0.781-0.918) in two different external validation sets. The simple model showed an AUROC of 0.795 (95% CI 0.781-0.808) in the internal test set and 0.766 (95% CI 0.744-0.789) and 0.782 (95% CI 0.687-0.877) in the two different external validation sets. This was higher than the value in the well-known scoring system (Mehran criteria, AUROC=0.67). The seven precatheterization variables selected for the simple model were age, known chronic kidney disease, hematocrit, troponin I, blood urea nitrogen, base excess, and N-terminal pro-brain natriuretic peptide. The simple model is available at http://52.78.230.235:8081/Conclusions We developed an AKI prediction machine learning model with reliable performance. This can aid in bedside clinical decision making.