Materials discovery is rapidly revolutionizing all aspects of our lives. However, the design and fabrication of materials are often unsustainable and resource-intensive. Hence, we need a paradigm shift towards designing sustainable materials in silico. Machine learning, a subfield of artificial intelligence (AI), is emerging within the sustainability agenda because it promises to benefit science and engineering through improved quality, performance, and predictive power. Here we present a new methodology to extend the application of AI to develop materials in an environmentally friendly way. We demonstrate successful materials development by combining design of experiments with a new machine learning module that comprises a support vector machine, an evolutionary algorithm, and a desirability function. We use our AI-based method to realize the sustainable electrochemical synthesis of ZIF-8 metal-organic framework and explore the hyperdimensional relationship between the synthesis parameters, product qualities, and process sustainability. The presented AI-based methodology paves the way for solving the challenge of the materials fabrication-sustainability nexus, and facilitates the paradigm shift from the wet lab to the wired lab.