The gut microbiota shapes the response to immune checkpoint inhibitors (ICIs) in cancer, however dietary and geographic influences have not been well-studied in prospective trials. To address this, we prospectively profiled baseline gut (fecal) microbiota signatures and dietary patterns of 103 trial patients from Australia and the Netherlands treated with neoadjuvant ICIs for high risk resectable metastatic melanoma and performed an integrated analysis with data from 115 patients with melanoma treated with ICIs in the United States. We observed geographically distinct microbial signatures of response and immune-related adverse events (irAEs). Overall, response rates were higher in Ruminococcaceae-dominated microbiomes than in Bacteroidaceae-dominated microbiomes. Poor response was associated with lower fiber and omega 3 fatty acid consumption and elevated levels of C-reactive protein in the peripheral circulation at baseline. Together, these data provide insight into the relevance of native gut microbiota signatures, dietary intake and systemic inflammation in shaping the response to and toxicity from ICIs, prompting the need for further studies in this area.