Catalyzes the NAD(P)-dependent oxidation of 4-(phosphooxy)-L-threonine (HTP) into 2-amino-3-oxo-4-(phosphooxy)butyric acid which spontaneously decarboxylates to form 3-amino-2-oxopropyl phosphate (AHAP). 4-(phosphooxy)-L-threonine + NAD(+) = 3-amino-2-oxopropyl phosphate + CO2 + NADH Binds 1 divalent metal cation per subunit. Can use ions such as Zn(2+), Mg(2+) or Co(2+). Cofactor biosynthesis; pyridoxine 5'-phosphate biosynthesis; pyridoxine 5'-phosphate from D-erythrose 4-phosphate: step 4/5. Homodimer. The active site is located at the dimer interface. Belongs to the PdxA family.