Abstract Ephedra is one of the world’s most important plants, used in medicine, plants and ecology. Most Ephedra grows in plain areas and is stable. But the plateau environment is special, with the change of altitude, the variety difference of plateau Ephedra saxatilis is very obvious. E. saxatilis metabolism on the Tibetan Plateau is not only affected by altitude, but also environmental conditions such as climate conditions and different soil components. However, the change mechanism of E. saxatilis alkaloids in special ecological environment is still unclear. Therefore, we analyzed the metabolic and altitude of E. saxatilis species in the Tibetan Plateau. Through the functional analysis of Kyoto Metabolism and Metabolomic Encyclopedia (KEGG), we can determine that the number of E. saxatilis metabolites decreases with the increase of altitude, and there are differences in metabolism among the three mountains. This was confirmed by univariate analysis of the top five metabolic pathways. Based on the analysis of soil and metabolomics, it was found that soil water content was also a factor affecting E. saxatilis metabolism. According to the difference of vertical height gradient, ephedrine and pseudephedrine showed the same change in vertical altitude under different mountains. Ephedrine increased as the altitude gradient increased, and pseudoephedrine decreased as the altitude gradient decreased. Our results provide valuable information for further study of metabolic mechanism and efficacy stability. It provides useful reference for the research of E. saxatilis planting in special area. 1 Introduction The medicinal resources of Ephedra are very rich, the metabolites in the body such as ephedrine, polysaccharide, flavonoids and so on are very rich [[34]1]. The stems of some Ephedra (ephedraceae) are rich in metabolites such as ephedrine and pseudoephedrine, effective for headaches, bronchial asthma, rhinitis, and the common cold [[35]2]. With the research of Ephedra more and more in-depth, people found that Ephedra contains a variety of chemical components, such as volatile oil, flavonoids, polysaccharides, amino acids, tannins, organic acids, lignans and trace elements, but alkaloids is still the most important medicinal ingredients of Ephedra [[36]3–[37]5]. Ephedra is distributed in 40 groups all over the world, such as Japan, Nepal, Uzbekistan, China and so on [[38]6–[39]9]. There are about 6 species in the southern Tibet Plateau of China. The Tibetan Plateau and its adjacent areas have strong ecosystem diversity and vegetation is obviously affected by local climate and topography [[40]10]. Previous studies on Ephedra mostly focused on the phylogeographic structure, phylogenetic reconstruction and chemical substances [[41]11, [42]12]. However, ecological investigation of the effects of altitude on alkaloids has not been established. E. saxatilis, which is unique to Tibet in China, E. saxatilis is difficult to pick due to its high altitude, so the analysis of ephedrine and pseudoephedrine can find the factors that determine its stable efficacy, which can provide references for our later cultivation of E. saxatilis and provide a