Abstract Background The anti-aging protein Klotho has diverse functions in antioxidative stress and energy metabolism through several pathways. While it has been reported that α-Klotho is downregulated in patients with insulin resistance (IR), the association between Klotho and IR is complex and controversial. The triglyceride-glucose (TyG) index has provided a practical method for assessing IR. With this in mind, our study aimed to investigate the relationship between the TyG index and soluble α-Klotho protein levels in US populations, both with and without diabetes mellitus. Methods This cross-sectional study analyzed data from middle-aged and older participants in the National Health and Nutrition Examination Survey (NHANES) conducted between 2007 and 2016. The participants were divided into two groups based on their diabetes mellitus status: those with diabetes and those without diabetes. To evaluate the relationship between the TyG index and the concentration of the α-Klotho protein in each group, a series of survey-weighted multivariable linear regression models were employed. Furthermore, to examine the association between these two variables, multivariable-adjusted restricted cubic spline curves and subgroup analysis were generated. Results The study involved 6,439 adults aged 40 years or older, with a mean age of 57.8 ± 10.9 years. Among them, 1577 (24.5%) had diabetes mellitus. A subgroup analysis indicated that the presence of diabetes significantly affected the relationship between the TyG index and the α-Klotho level. After considering all covariables, regression analysis of the participants without diabetes revealed that the α-Klotho concentration decreased by 32.35 pg/ml (95% CI: -50.07, -14.64) with each one unit increase in TyG (p