Although immunotherapy with immune checkpoint inhibitors (ICIs) has been remarkably effective across multiple cancer types. Several reports showed the gut microbiome is a possible factor proposed to impact the efficacy of ICI. The relationship between gut microbiome and immune status in tumor microenvironment remains unclear. Short-chain fatty acids (SCFAs) are major end products of gut microbiota metabolites and are known to wide-ranging impacts on host physiology. The objective of this study was to evaluate the fecal SCFA (fSCFA) in solid cancer patients treated with anti-programmed death-1 inhibitor (PD1i). This was a prospective study of patients with cancer who were treated with nivolumab (2 mg/kg, every 3 weeks; 3 mg/kg, every 2 weeks; or 240 mg/body, every 2 weeks) or pembrolizumab (200 mg/body, every 3 weeks) at Kyoto University Hospital between July 2016 and April 2018. Patients were classified into two groups: responder (R) with an objective response and non-responder (NR) according to the Response Evaluation Criteria in Solid Tumors version 1.1. Fecal samples were collected before administration of PD-1 inhibitor and were analyzed by the ultra-high performance liquid chromatography-tandem mass spectrometry system. A total of 40 patients (melanoma 19; head and neck cancer 7; gastrointestinal cancer 7; genitourinary cancer 4; other 3) were enrolled. The response rate was 22.5%. The fSCFAs in R patients (n = 9) were significantly higher than that in NR patients (n = 31) (p < 0.001). Progression-free survival (PFS) was significantly longer in patients with high fSCFAs than patients with lower fSCFAs (median 5.5 vs. 1.4 months, hazard ratio [HR] 0.35, 95% confidence interval [CI] 0.17-0.72). In melanoma patients, PFS was also significantly longer in patients with high fSCFAs than that with lower fSCFAs (median 6.1 vs. 1.4 months, HR 0.30, 95% CI 0.10-0.89). The fSCFA could predict the efficacy of PD1i. UMIN000023303. The authors. Novartis Pharma. M. Nomura: Research grant / Funding (self): Novartis Pharma. All other authors have declared no conflicts of interest.