In this work, we present a novel AI-based optimization approach of Power-to-ammonia projects. We demonstrate that the cost of green ammonia (LCOA) can be optimized by considering the location, desired production scale and flexibility of the technology used. The results challenge the conventional approach of enhancing economic results by maximizing energy utilization, highlighting the need for tailored location-based design solutions considering large periods (> 30 years) of historic data.