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). Here, AIP is linked to diabetes mellitus.