Alkylphenols (APs) may cause gestational diabetes mellitus (GDM) in pregnant women by impairing glucose metabolism through endocrine disruption. However, the current literature has limited epidemiological evidence on the association between APs exposure and the risk of GDM, especially the lack of evidence on joint exposure. Thus, we evaluated the effect of exposure to APs during early pregnancy on the risk of GDM. The study involved 2035 pregnant women from Guangxi Zhuang Birth Cohort (GZBC) in China. Poisson regression model, restricted cubic spline (RCS), Bayesian kernel machine regression (BKMR), and quantile g-computation (Qgcomp) were conducted to evaluate the effects of serum APs levels on the risk of GDM in pregnant women. For each Ln-unit increase in the serum nonylphenol (NP) of pregnant women, the adjusted relative risk (RR) for GDM risk was 1.12 (95 % CI: 1.00, 1.24). After sex stratification, the effect was more pronounced among pregnant women carrying female fetuses(RR=1.22; 95 % CI: 1.09, 1.38). The serum 4-t-octylphenol (4-T-OP) of the medium-exposure (adjusted RR = 3.25: 95 % CI: 1.30, 8.12) and high-exposure groups (adjusted RR = 2.90: 95 % CI: 1.15, 7.31) were related to a significantly increased risk of GDM in pregnant women carrying female fetuses only when compared to the low-exposure group. A reverse U-shaped nonlinear association was found between 4-n-octylphenol (4-N-OP) and 4-n-nonylphenol (4-N-NP) concentrations and GDM risk, and it was more susceptible in pregnant women carrying female fetuses. The Qgcomp and BKMR models showed that exposure to APs mixtures was correlated with an elevated risk of GDM in pregnant women carrying female fetuses (adjusted OR = 1.90: 95 % CI: 1.07, 3.38). Exposure to APs during early pregnancy may have potential fetal sex-specific effects on the risk of GDM, with pregnant women carrying female fetuses being more susceptible.