Capsules were widely used in clinical settings for the oral delivery of various drugs, although it remains challenging to trace real-time drug release behavior and adjust dosages based on the therapeutic effect. To address these issues, we developed theranostic capsules that loaded two kinds of fluorescence nanoparticles, H 2 O 2 -responsive Janus Ag/Ag 2 S nanoparticles (Ag/Ag 2 S JNPs) and the downconversion nanoparticles (DCNPs), and the dexamethasone (Dex) drug. The Ag/Ag 2 S JNPs exhibit a highly sensitive fluorescence (FL) signal at 1250 nm in response to H 2 O 2 , while the FL signal from the DCNPs at 1550 nm remains stable under physiological conditions. The ratio of these two FL signals formed the ratiometric FL signal, which shows correlation with the H 2 O 2 concentration with a detection limit of 1.7 μM. Moreover, the capsules can be precisely delivered into the intestine, where they release the JNPs and DCNPs simultaneously. The H 2 O 2 -triggered ratiometric FL signals and images can diagnose inflammation and indicate its location. Meanwhile, the encapsulated Dex is released in the disease region, with ratiometric imaging allowing for real-time tracking of therapeutic efficacy and providing guidance for ongoing treatment. The theranostic capsule system provides an approach for quantitative detection of disease biomarkers and further localized release of therapeutics, thereby avoiding overdose and reducing side effects.