The horizontal ecological compensation plays an important role in balancing the interests of all parties and coordinating regional development in the basin. However, the mechanism of ecological compensation based on embodied carbon emissions is still poorly understood. Here, taking the Yellow River Basin as the research area, we use the multi-regional input-output (MRIO) model to measure the embodied carbon transfers between its seven urban agglomerations in 2012 and 2017 from the viewpoint of value-added trade benefits. Further, for the first time, the green trade benefits and ecological compensation amounts are analyzed. The results indicate that: (1) The transfer of trade-embodied carbon among the urban agglomerations in the basin showed obvious spatial heterogeneity and geographic proximity effects, and trade-embodied carbon outflows (inflows) had a pattern of "highest in the midstream, second in the downstream, and lowest in the upstream". (2) The industry composition of the urban agglomerations in relation to embodied carbon outflows (inflows) was similar, mainly in the service and heavy manufacturing industries. (3) The spatial pattern of green trade benefits in the basin had shifted from "high in the north and low in the surrounding area" to "high in the east-central part and low in the west". (4) The pattern of ecological compensation in the basin had shifted from the upstream surplus, the middle and downstream deficit to the midstream deficit, and the upstream and downstream surplus. Therefore, we recommend improving energy structures in high-demand urban agglomerations by adopting clean energy, focusing on decarbonization and energy efficiency in resource-rich regions. Additionally, promoting low-carbon economies, especially in the service and heavy manufacturing industries, implementing differentiated emission reduction strategies, and optimizing carbon compensation mechanisms considering regional disparities and resource endowments are crucial. It is expected that the study can enrich the scientific basis of horizontal ecological compensation and increase the fairness of regional carbon emission rights allocation.