The search for non-toxic and low-cost perovskites with high thermoelectric performance is still a challenge despite low thermal conductivity. The thermoelectric properties of nitride anti-perovskites X3BN (B = Bi, Sb, X = Mg, Ca, Sr) with a cubic structure were investigated using density functional theory and machine learning interatomic potential. The low Debye temperature and thermal conductivity were obtained due to strong lattice anharmonicity, and the phonon vibration modes were also analyzed. The high band degeneracy and suitable bandgap lead to a large power factor. The maximum power factor is 7.54 mW/mk2 for Mg3BiN at 900 K. We obtained a maximum ZT of 1.49 for p-type Sr3BiN, and it is 1.22 for n-type doping at 900 K. The ZT for Mg3BiN is 1.18 and 1.19 for p-type and n-type doping, respectively. Our calculations reveal that these anti-perovskites are excellent materials for non-toxic and low-cost thermoelectric applications.