The invention belongs to the field of medicines or health care products, and in particular relates to the use of C. citronella C21 steroids in the preparation of IDO inhibitors. The present invention finds through the research that salivaside C, salivaside D, salivaside O, salivaside P, salivaside Q, salivaside R, salivaside S, salivaside M and salivaside N The inhibitory activity to intracellular IDO is better than that of the positive control drug 1-methyltryptophan (1-MT) to the inhibitory activity of intracellular IDO, has significant IDO inhibitory activity, and can be used for the treatment of cancer, albino Alzheimer's disease, autoimmune disease, ankylosing spondylitis, bacterial infection, cataracts, mood disorder, depression, or anxiety.