Responding patients (R group) after immunotherapy showed significantly higher gut microbiota α-diversity than non-responding patients (NR group), with distinct microbial composition between the two groups. The R group was enriched with Faecalibacterium, Clostridium_sensu_stricto_1, and Ruminococcus_torques, while the NR group showed enrichment of Dubosiella and coriobacteriaceae_UCG-002. Additionally, R group patients exhibited upregulated SCFAs post-treatment, and metabolites associated with PD-L1 expression and PD-1 checkpoint pathway in cancer were enriched in KEGG pathways. Here, CD274 is linked to cancer.