This paper mainly focuses on the optimal consensus control of nonlinear multi-agent systems (MASs). The performance index function is introduced to describe this problem, and the augmented state vector is defined to assist in realizing the optimal consensus control protocol through parallel control, which avoids the requirement of prior model knowledge in the traditional optimal control based on adaptive dynamic program-ming (ADP). By establishing the relationship between the optimal consensus control and the multiplayer game, it is known that the final optimal consensus control protocol of each agent is the solution of the Nash equilibrium. A critic neural network (NN) is introduced to complete the optimal parallel consensus control online. Finally, an example is given to demonstrate the effectiveness of the proposed method and the stability of the system is verified.