R^4, purified
We derive, using the pure-spinor formalism, the complete -- including the fermions -- four-point effective action of both type II superstrings to all orders in $\alpha'$, at tree level in string loops. We find that, in the quartic-field approximation, the supergravity Lagrangian can be thought of as the tensor product, in a suitable sense, of two copies of the superYang-Mills Lagrangian in ten dimensions. The NS-NS three-form enters the supergravity Lagrangian through a modified connection with torsion. As a byproduct, we derive the complete, i.e. to all orders in the $\theta$-expansion, closed-string vertex operator in a flat target-space background.