The utilization of antibiotics increases the prevalence of antibiotic resistance genes (ARGs) in various matrices and poses the potential risk of ARG transmission, garnering global attention. Antimicrobial peptides (AMPs) represent a promising novel category of antimicrobials that may address the urgent issue of antibiotic resistance. Here, a zebrafish cultivation assay in which zebrafish were fed a diet supplemented with AMP (Cecropin A) or antibiotics was conducted to determine the effects of the intervention on the microorganisms and antibiotic resistance spectrum in zebrafish gut samples. Cecropin A treatment decreased the α-diversity of the microbiota. Moreover, NMDS (nonmetric multidimensional scaling) results revealed that the β-diversity in the microbiota was more similar between the control (CK) and Cecropin A samples than between the antibiotic treatment groups. The absolute quantity of ARGs in the AMP treatment was less than that observed in the antibiotic treatment. The findings indicated that FFCH7168, Chitinibacter and Cetobacterium were the most significant biomarkers detected in the CK, Cecropin A and antibiotic treatments, respectively. Although the use of antibiotics notably enhanced the occurrence of multidrug-resistant bacteria, the application of Cecropin A did not lead to this phenomenon. The results indicated that the application of AMPs can effectively manage and control ARGs in aquaculture.