This study used artificial intelligence (AI)-based analysis to investigate the immune microenvironment in endometrial cancer (EC). We aimed to evaluate the potential of AI-based immune metrics as prognostic biomarkers. In total, 296 cases with EC were classified into 4 molecular subtypes: polymerase epsilon ultramutated (POLEmut), mismatch repair deficiency (MMRd), p53 abnormal (p53abn), and no specific molecular profile (NSMP). AI-based methods were used to evaluate the following immune metrics: total tumor-infiltrating lymphocytes (TIL), intratumoral TIL, stromal TIL, and tumor cells using Lunit SCOPE IO, as well as CD4+, CD8+, and FOXP3+ T cells using immunohistochemistry (IHC) by QuPath. These 7 immune metrics were used to perform unsupervised clustering. PD-L1 22C3 IHC expression was also evaluated. Clustering analysis demonstrated 3 distinct immune microenvironment groups: immune active, immune desert, and tumor dominant. The immune-active group was highly prevalent in POLEmut, and it was also seen in other molecular subtypes. Although the immune-desert group was more frequent in NSMP and p53mut, it was also detected in MMRd and POLEmut. POLEmut showed the highest levels of CD4+ and CD8+ T cells, total TIL, intratumoral TIL, and stromal TIL with the lowest levels of FOXP3+/CD8+ ratio. In contrast, p53abn in the immune-active group showed higher FOXP3+/CD4+ and FOXP3+/CD8+ ratios. The immune-active group was associated with favorable overall survival and recurrence-free survival. In the NSMP subtype, a significant association was observed between immune active and better recurrence-free survival. The PD-L1 22C3 combined positive score (CPS) showed significant differences among the 3 groups, with the immune-active group having the highest median CPS and frequency of CPS ≥ 1%. The immune microenvironment of EC was variable within molecular subtypes. Within the same immune microenvironment group, significant differences in immune metrics and T cell composition were observed according to molecular subtype. AI-based immune microenvironment groups served as prognostic markers in ECs, with the immune-active group associated with favorable outcomes.