Urban greenspaces (UGS) are increasingly recognised as crucial for mitigating urban heat exposure in advancing sustainable development goals. However, limited understanding of spatial heterogeneity in cooling effects hinders optimizing UGS benefits. Moreover, most studies focus solely on relationship exploration, lacking comprehensive assessment frameworks for practical decision-making. We propose a data-driven framework that combines machine learning with local interpretability and benefit evaluation to analyze spatial heterogeneity, guide spatial decisions, and assess decision cooling benefits (measured as reduced population exposure to land surface temperature extremes). Using Beijing as a case study, we investigated UGS cooling effects’ nonlinear impacts and spatial heterogeneity and validated the effectiveness of spatial decisions incorporating such heterogeneity. Our findings reveal that: (1) Beyond greenspace coverage, the spatial configuration and morphology of UGS significantly mitigate urban heat exposure; (2) All UGS landscape indicators exhibit nonlinear and threshold effects, with their cooling efficiency varying across areas due to interactions with regional environmental factors; (3) The spatial inequality in cooling benefits exceeds that of UGS indicator distribution; (4) Integrating regional heterogeneity of cooling benefits to prioritise optimal areas can more than double mitigation benefits (when only 10% of areas can be optimised). The proposed framework achieves equivalent benefits while optimizing only 40% of the region compared to random methods. This study advances the understanding of greenspace benefits from distribution heterogeneity to cooling effect heterogeneity. These insights emphasize the importance of considering regional heterogeneity in urban spatial planning, providing theoretical and practical support for enhancing urban sustainability and resident well-being through UGS.