Circadian clocks are self-sustained biological oscillators that can be entrained by environmental cues. Although this phenomenon has been studied in many organisms, the molecular mechanisms of entrainment remain unclear. Three cyanobacterial proteins and adenosine triphosphate (ATP) are sufficient to generate oscillations in phosphorylation in vitro. We show that changes in illumination that induce a phase shift in cultured cyanobacteria also cause changes in the ratio of ATP to adenosine diphosphate (ADP). When these nucleotide changes are simulated in the in vitro oscillator, they cause phase shifts similar to those observed in vivo. Physiological concentrations of ADP inhibit kinase activity in the oscillator, and a mathematical model constrained by data shows that this effect is sufficient to quantitatively explain entrainment of the cyanobacterial circadian clock.