The present work aims the modeling and optimal control of an autonomous quadruped robot. Due to variations in the topology and the degree of freedom of the robot during its motion, two different modeling approaches were considered: firstly, the robot was considered with at least two legs supporting its body or platform and, second one, was considered the model of a leg in the air. In both cases, was presented the solution of the direct and inverse kinematic problem of position through the Denavit-Hartenberg parameterization. Were analyzed also, the kinematic problem of speed and the singularities through the Jacobian matrix, and was also obtained the dynamic model of the system using the Principle of Virtual Work or the d'Alembert method and the iterative Newton-Euler method for the platform and legs, respectively. From these two dynamic model, were developed an algorithm for optimizing the power losses of the motors that driven the joints. In this sense, was used the strategy of independent control for each joint. Such a strategy, along with the discretization in time of the system model, has helped to change the initial optimization problem for each joint in a Quadratic Programming Problem, more simpler to solve. After solving these problems, and to take into account the interactions between the dynamics of various joints, was proceeded to search for a fixed point or a global minimum that would characterize the total energy spent in moving for the system. Finally, held the demonstration and analysis of convergence of the algorithm was tested in the control of gait of the Kamambaré robot. As a result of the test, we observed the good performance of the formulation and the feasibility of its implementation in real systems.