BackgroundCutaneous melanoma (CM) has an overall poor prognosis due to a high rate of metastasis. This study aimed to explore the role of hypoxia-related genes (HRGs) in CM.MethodsWe first used on-negative matrix factorization consensus clustering (NMF) to cluster CM samples and preliminarily analyzed the relationship of HRGs to CM prognosis and immune cell infiltration. Subsequently, we identified prognostic-related hub genes by univariate COX regression analysis and the least absolute shrinkage and selection operator (LASSO) and constructed a prognostic model. Finally, we calculated a risk score for patients with CM and investigated the relationship between the risk score and potential surrogate markers of response to immune checkpoint inhibitors (ICIs), such as TMB, IPS values, and TIDE scores.ResultsThrough NMF clustering, we identified high expression of HRGs as a risk factor for the prognosis of CM patients, and at the same time, increased expression of HRGs also indicated a poorer immune microenvironment. Subsequently, we identified eight gene signatures (FBP1, NDRG1, GPI, IER3, B4GALNT2, BGN, PKP1, and EDN2) by LASSO regression analysis and constructed a prognostic model.ConclusionOur study identifies the prognostic significance of hypoxia-related genes in melanoma and shows a novel eight-gene signature to predict the potential efficacy of ICIs.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12920-023-01587-8.