Abstract Steroidal glycoalkaloids (SGAs) are defensive and anti-nutritional metabolites in Solanum plants with extensive structural diversity and bioactivity. However, the chemical profiles and molecular mechanisms underlying the structural diversity of SGAs in potato (Solanum section Petota) remain poorly understood. We performed metabolomic analyses on 68 accessions from 46 species, quantifying 64 SGAs with 3 structural types (solanidane, spirosolane 22αN, and spirosolane 22βN). These revealed marked interspecific differences in SGA composition and content, with five distinct SGA clusters corresponding to four sample subgroups. We constructed a de novo pan-transcriptome yielding a high-quality expression dataset encompassing 32,844 genes, including 4,848 assembled genes absent from the reference genome. Integrative metabolome–transcriptome analyses identified 193 candidate genes involved in SGA structural modification. Five 2-oxoglutarate-dependent dioxygenase (2ODD) and GAME25 genes were identified as key regulators driving SGA structural variation. We performed experimental validation to characterize the function of a 2ODD member that specifically catalyzes C-23 hydroxylation of spirosolane 22αN-type SGAs, with a preference for glycosylated α-solasonine over solasodine. This study establishes a metabolite-gene atlas elucidating SGA diversity in Solanum sect. Petota, providing valuable resources for leveraging SGA diversity in potato breeding programs.