Women with polycystic ovary syndrome are prone to develop gestational diabetes mellitus, a disease which may have significant impact on the postpartum health of both mother and infant. We performed a retrospective cohort study to develop and test a model that could predict gestational diabetes mellitus in the first trimester in women with polycystic ovary syndrome. Our study included 434 pregnant women who were referred to the obstetrics department between December 2017 and March 2020 with a diagnosis of polycystic ovary syndrome. Of these women, 104 were diagnosed with gestational diabetes mellitus in the second trimester. Univariate analysis revealed that in the first trimester, Hemoglobin A1c (HbA1C), age, total cholesterol(TC), low-density lipoprotein cholesterol (LDL-C), SBP (systolic blood pressure), family history, body mass index (BMI), and testosterone were predictive factors of gestational diabetes mellitus (P< 0.05). Logistic regression revealed that TC, age, HbA1C, BMI and family history were independent risk factors for gestational diabetes mellitus. The area under the ROC curve of the gestational diabetes mellitus risk prediction model was 0.937 in this retrospective analysis, demonstrating a great discriminatory ability. The sensitivity and specificity of the prediction model were 0.833 and 0.923, respectively. The Hosmer–Lemeshow test also showed that the model was well calibrated.