This study presents real-time cooperative control for optimal collision-free transfers of multiple active (actuated) spacecraft in proximity operations. In the framework of an optimal control problem for a single active spacecraft, the cost functions for tracking reference solutions and avoiding obstacles are integrated with a quadratic cost function for continuous-thrust control. Then, the infinite-horizon control law applicable to each of multiple spacecraft is obtained as an algebraic function of the states of reference solutions and obstacles by employing discrete-time generating functions. Unlike conventional methods based on shooting, the proposed approach does not require repetitive process and initial guesses regardless of the number of active spacecraft. The illustrative examples validate the proposed approach of optimal collision-free transfers for multiple active spacecraft.