Legume-rhizobium symbiosis in root nodules fixes nitrogen to satisfy the plant's nitrogen demands. The nodules' demand for energy is thought to determine nitrogen fixation rates. How this energy state is sensed to modulate nitrogen fixation is unknown. Here, we identified two soybean (Glycine max) cystathionine β-synthase domain-containing proteins, nodule AMP sensor 1 (GmNAS1) and NAS1-associated protein 1 (GmNAP1). In the high-nodule energy state, GmNAS1 and GmNAP1 form homodimers that interact with the nuclear factor-Y C (NF-YC) subunit (GmNFYC10a) on mitochondria and reduce its nuclear accumulation. Less nuclear GmNFYC10a leads to lower expression of glycolytic genes involved in pyruvate production, which modulates phosphoenolpyruvate allocation to favor nitrogen fixation. Insight into these pathways may help in the design of leguminous crops that have improved carbon use, nitrogen fixation, and growth.