We theoretically studied the electronic structure, magnetic properties, and lattice dynamics of a series of 3d transition-metal antiperovskite compounds AXM3 by density function theory. Based on the Stoner criterion, we drew the magnetic phase diagram of carbon-based antiperovskites ACM3. In the phase diagram, compounds with non-magnetic ground state but locating near the ferromagnetic boundary are suggested to yield sizeable electron-phonon coupling and behave superconductivity. To approve this deduction, we systematically calculated the phonon spectra and electron-phonon coupling of a series of Cr-based antiperovskites ACCr3 and ANCr3. The results show that AlCCr3, GaCCr3, and ZnNCr3 could be moderate coupling BCS superconductors. The influence of spin fluctuation on superconductivity are discussed. Furthermore, other potential superconducting AXM3 including some new Co-base and Fe-based antiperovskite superconductors are predicted from the magnetic phase diagram.