Spatially targeted, genetically-specific strategies for sustained inhibition of nociceptors may help transform pain science and clinical management. Previous optogenetic strategies to inhibit pain have required constant illumination, and chemogenetic approaches in the periphery have not been shown to inhibit pain. Here, we show that the step-function inhibitory channelrhodopsin, SwiChR, can be used to persistently inhibit pain for long periods of time through infrequent transdermally delivered light pulses, reducing required light exposure by >98% and resolving a long-standing limitation in optogenetic inhibition. We demonstrate that the viral expression of the hM4D receptor in small-diameter primary afferent nociceptor enables chemogenetic inhibition of mechanical and thermal nociception thresholds. Finally, we develop optoPAIN, an optogenetic platform to non-invasively assess changes in pain sensitivity, and use this technique to examine pharmacological and chemogenetic inhibition of pain.