We consider the overlap of Bethe vectors of the XXX spin chain with a diagonal twist and the modified Bethe vectors with a general twist. We find a determinant representation for this overlap under one additional condition on the twist parameters. Su
ch objects arise in the calculations of nonequilibrium physics.
We show that the scalar products of on-shell and off-shell Bethe vectors in the algebra1ic Bethe ansatz solvable models satisfy a system of linear equations. We find solutions to this system for a wide class of integrable models. We also apply our me
thod to the XXX spin chain with broken $U(1)$ symmetry.