The genus Solanum comprises three food crops (potato, tomato, and eggplant), which are consumed on daily basis worldwide and also producers of notorious anti-nutritional steroidal glycoalkaloids (SGAs). Hydroxylated SGAs (i.e. leptinines) serve as precursors for leptines that act as defenses against Colorado Potato Beetle (Leptinotarsa decemlineata Say), an important pest of potato worldwide. However, SGA hydroxylating enzymes remain unknown. Here, we discover that 2-OXOGLUTARATE-DEPENDENT-DIOXYGENASE (2-ODD) enzymes catalyze SGA-hydroxylation across various Solanum species. In contrast to cultivated potato, Solanum chacoense, a widespread wild potato species, has evolved a 2-ODD enzyme leading to the formation of leptinines. Furthermore, we find a related 2-ODD in tomato that catalyzes the hydroxylation of the bitter α-tomatine to hydroxytomatine, the first committed step in the chemical shift towards downstream ripening-associated non-bitter SGAs (e.g. esculeoside A). This 2-ODD enzyme prevents bitterness in ripe tomato fruit consumed today which otherwise would remain unpleasant in taste and more toxic. © 2019, The Author(s).