PurposeThe objective of this study was to investigate the key glycolysis-related genes linked to immune cell infiltration in endometriosis and to develop a new endometriosis (EMS) predictive model.MethodsA training set and a test set were created from the Gene Expression Omnibus (GEO) public database. We identified five glycolysis-related genes using least absolute shrinkage and selection operator (LASSO) regression and the random forest method. Then, we developed and tested a prediction model for EMS diagnosis. The CIBERSORT method was used to compare the infiltration of 22 different immune cells. We examined the relationship between key glycolysis-related genes and immune factors in the eutopic endometrium of women with endometriosis. In addition, Gene Ontology (GO)-based semantic similarity and logistic regression model analyses were used to investigate core genes. Reverse real-time quantitative PCR (RT-qPCR) of 5 target genes was analysed.ResultsThe five glycolysis-related hub genes (CHPF, CITED2, GPC3, PDK3, ADH6) were used to establish a predictive model for EMS. In the training and test sets, the area under the curve (AUC) of the receiver operating characteristic curve (ROC) prediction model was 0.777, 0.824, and 0.774. Additionally, there was a remarkable difference in the immune environment between the EMS and control groups. Eventually, the five target genes were verified by RT-qPCR.ConclusionThe glycolysis-immune-based predictive model was established to forecast EMS patients’ diagnosis, and a detailed comprehension of the interactions between endometriosis, glycolysis, and the immune system may be vital for the recognition of potential novel therapeutic approaches and targets for EMS patients.Supplementary InformationThe online version contains supplementary material available at 10.1007/s10815-023-02769-0.