We dimensionally reduce the spacetime action of bosonic string theory, and that of the bosonic sector of heterotic string theory after truncating the Yang-Mills gauge fields, on a $d$-dimensional torus including all higher-derivative corrections to first order in $alpha$. A systematic procedure is developed that brings this action into a minimal form in which all fields except the metric carry only first order derivatives. This action is shown to be invariant under ${rm O}(d,d,mathbb{R})$ transformations that acquire $alpha$-corrections through a Green-Schwarz type mechanism. We prove that, up to a global pre-factor, the first order $alpha$-corrections are uniquely determined by ${rm O}(d,d,mathbb{R})$ invariance.