Catalyzes the final reductions in tetra-hydrobiopterin biosynthesis to form 5,6,7,8-tetrahydrobiopterin. L-threo-7,8-dihydrobiopterin + NADP(+) = H(+) + NADPH + sepiapterin L-threo-tetrahydrobiopterin + 2 NADP(+) = 6-pyruvoyl-5,6,7,8-tetrahydropterin + 2 H(+) + 2 NADPH Slightly inhibited by N-acetyldopamine but not by N-acetylserotonin or melatonin. For the reverse reaction, accepts L-threo-dihydrobiopterin, D-threo-dihydrobiopterin, L-threo-dihydroneopterin, dihydrotepidopterin and L-erythro-dihydrobiopterin as substrates. Optimum pH is around 8.8. Activity drops sharply above and below the optimum and is absent at pH 3 and virtually so at pH 10.6. Optimum temperature is 50 degrees Celsius. Stable at 25 and 50 degrees Celsius for 2 h but loses activity at 70 degrees Celsius in 20 min. Homodimer. Belongs to the short-chain dehydrogenases/reductases (SDR) family.