Adenosine 5′-triphosphate (ATP) plays an essential role in regulating many metabolic activities. Therefore, developing tools to directly measure ATP in real time will help us understand its underlying functions. Here, we report an optimized genetically encoded ATP sensor (OAS1.0) with a high specificity for ATP detection. OAS1.0 can be genetically targeted to specific cell types and subcellular compartments to monitor ATP production and consumption. We also used OAS1.0 to visualize metabolic-activity-dependent changes in ATP in normal and tumor cell lines and ATP consumption during the virus–host interaction process. OAS1.0 also worked well with a Ca2+ sensor to concurrently monitor ATP and Ca2+ dynamics in living cells. Thus, OAS1.0 represents a promising tool for ATP imaging under both physiological and pathophysiological conditions.