Diabetes mellitus is a metabolic disorder characterized by elevated blood glucose levels. Alpha-amylase inhibitors are chemicals that prevent amylase from degrading carbohydrates into monosaccharides. For instance, the Raru plant (Cotylelobium melanoxylon), which was widely used by the local people, particularly in Sumatra, was used to lower blood glucose levels. The goal of this study was to isolate an endophytic fungus from the Raru plant and test its alpha-amylase activity by optimizing treatment time, substrate concentration, and alpha-amylase inhibitor compound extraction. The activity of alpha-amylase was measured using spectrophotometry, and starch was used as the substrate. Four isolates of the endophytic fungus were isolated from Raru bark, including TR1, TR2, TR3, and TR4. Of these, the isolate TR3 had the highest alpha-amylase activity, reaching 88.71%. Alpha-amylase was optimally inhibited for 7 days with a percentage of 90.13%. At a substrate concentration of 2%, the inhibition of alpha-amylase was observed at 96.34%. While the highest extraction of alpha-amylase inhibitory compound was observed at 0.13 ppm with a percentage of 74.71% inhibition. Based on GC-MS (gas chromatography mass spectrometry) analysis, compound 24, identified as1,3-benzenedicarboxylic acid, bis (2-ethylhexyl) ester, isophthalic acid group, was produced by endophytic fungi, exerting alpha-amylase inhibitory activity. This research would provide a new source of chemical agents to combat diabetes.