2020 The Author(s). The Author(s). We study an optimal transport problem where, at some intermediate time, the mass is either accelerated by an external force field or self-interacting. We obtain the regularity of the velocity potential, intermediate density, and optimal transport map, under the conditions on the interaction potential that are related to the so-called Ma-Trudinger-Wang condition from optimal transport [X.-N. Ma, N. S. Trudinger and X.-J. Wang, Regularity of potential functions of the optimal transportation problems, Arch. Ration. Mech. Anal. 177 (2005) 151-183.].