RCS analysis demonstrated a nonlinear relationship between baseline AIP and depression risk in both Pre-DM and DM participants (Pre-DM: P for nonlinear < 0.001; DM: P for nonlinear < 0.001). This evidence concerns the gene AIP and major depressive disorder.