BackgroundGestational diabetes mellitus (GDM) represents the main metabolic alteration during pregnancy. The available methods for diagnosing GDM identify women when the disease is established, and pancreatic beta-cell insufficiency has occurred.The present study aimed to generate an early prediction model (under 18 weeks of gestation) to identify those women who will later be diagnosed with GDM.MethodsA cohort of 75 pregnant women was followed during gestation, of which 62 underwent normal term pregnancy and 13 were diagnosed with GDM. Targeted metabolomics was used to select serum biomarkers with predictive power to identify women who will later be diagnosed with GDM.ResultsCandidate metabolites were selected to generate an early identification model employing a criterion used when performing Random Forest decision tree analysis. A model composed of two short-chain acylcarnitines was generated: isovalerylcarnitine (C5) and tiglylcarnitine (C5:1). An analysis by ROC curves was performed to determine the classification performance of the acylcarnitines identified in the study, obtaining an area under the curve (AUC) of 0.934 (0.873–0.995, 95% CI). The model correctly classified all cases with GDM, while it misclassified ten controls as in the GDM group. An analysis was also carried out to establish the concentrations of the acylcarnitines for the identification of the GDM group, obtaining concentrations of C5 in a range of 0.015–0.25 μmol/L and of C5:1 with a range of 0.015–0.19 μmol/L.ConclusionEarly pregnancy maternal metabolites can be used to screen and identify pregnant women who will later develop GDM. Regardless of their gestational body mass index, lipid metabolism is impaired even in the early stages of pregnancy in women who develop GDM.Supplementary InformationThe online version contains supplementary material available at 10.1186/s13098-023-01098-7.