Cardiac surgery‐associated acute kidney injury (CS‐AKI) occurs in approximately 65% of neonates undergoing cardiac surgery on cardiopulmonary bypass and contributes to morbidity and mortality. Caffeine may reduce CS‐AKI by counteracting adenosine receptor upregulation after bypass, but pharmacokinetics (PK) in this population are unknown. The goal of our analysis is to address knowledge gaps in age‐, disease‐, and bypass‐related effects on caffeine disposition and explore preliminary associations between caffeine exposure and CS‐AKI using population PK modeling techniques and an opportunistic, electronic health record‐integrated trial design.We prospectively enrolled neonates receiving preoperative caffeine per standard of care and collected PK samples. We retrospectively identified neonates without caffeine exposure undergoing surgery on bypass as a control cohort. We followed US Food and Drug Administration guidance for population PK model development using NONMEM. Effects of clinical covariates on PK parameters were evaluated. We simulated perioperative exposures and used multivariable logistic regression to evaluate the association between caffeine exposure and CS‐AKI.Twenty‐seven neonates were included in model development. A 1‐compartment model with bypass time as a covariate on clearance and volume of distribution best fit the data. Twenty‐three neonates with caffeine exposure and 109 controls were included in the exposure‐response analysis. Over half of neonates developed CS‐AKI. On multivariable analysis, there were no significant differences between CS‐AKI with and without caffeine exposure. Neonates with single‐ventricle heart disease without CS‐AKI had consistently higher simulated caffeine exposures. Our results highlight areas for further study to better understand disease‐ and bypass‐specific effects on drug disposition and identify populations where caffeine may be beneficial.