Gut microbiota plays essential roles in maintaining gut homeostasis. The composition of gut microbes and their metabolites are altered in response to diet and remedial agents such as antibiotics. However, little is known about the effect of antibiotics on the gut microbiota and their volatile metabolites. In this study, we evaluated the impact of a moderate level of ampicillin treatment on volatile fatty acids (VFAs) of gut microbial cultures using an optimized real-time secondary electrospray ionization coupled with high-resolution mass spectrometry (SESI-HRMS). To evaluate the ionization efficiency, different types of electrospray solvents and concentrations of formic acid as an additive (0.01, 0.05, and 0.1%, v/v) were tested using VFAs standard mixture (C2–C7). As a result, the maximum SESI-HRMS signals of all studied m/z values were observed from water with 0.01% formic acid than those from the aqueous methanolic solutions. Optimal temperatures of sample inlet and ion chamber were set at 130 °C and 85 °C, respectively. SESI spray pressure at 0.5 bar generated the maximum intensity than other tested values. The optimized SESI-HRMS was then used for the analysis of VFAs in gut microbial cultures. We detected that the significantly elevated C4 and C7 VFAs in the headspace of gut microbial cultures six hours after ampicillin treatment (1 mg/L). In conclusion, our results suggested that the optimized SESI-HRMS method can be suitable for the analysis of VFAs from gut microbes in a rapid, sensitive, and non-invasive manner.