Controlling nonlinear optical signals electrically offers many opportunities for technological developments. Lanthanide-activated nanoparticles have recently emerged as leading platforms for nonlinear upconversion of infra-red excitation within nanometric volumes. However, manipulation of upconversion emission is restricted to varying percentages of component materials, nanocrystal structure, and optical pumping conditions. Here, we report temporal modulation of anti-Stokes luminescence by coupling upconversion nanoparticles with an electrochemically responsive molecule. By electrically tailoring orbital energy levels of the molecules anchored on nanoparticle surfaces, we demonstrate reversible control of molecular absorption, resulting in dynamic colour editing of anti-Stokes luminescence at single-particle resolution. Moreover, we show that a programmable logic gate array based on opto-electrochemical modulation can be constructed to convert information-encrypted electrical signals into visible patterns with millisecond photonic readout. These findings offer insights into precise control of anti-Stokes luminescence, while enabling a host of applications from low-threshold infrared logic switches to multichannel, high-fidelity photonic circuits.