Legged robots made of rigid links have disadvantages like poor energy efficiency and large impact forces during foot/terrain contact while walking on 3D uneven terrain. This paper proposes a unique design of an 18 DOF quadruped robot with compliant shanks. Compliance has been added to the quadruped by introducing a “c-section“ in the shank of each leg. The robot dynamics has been modeled using the projected Newton-Euler method, while the “Craig-Bampton Method” has been utilized to model the compliant shanks. Optimal body trajectory and foot placements while maintaining dynamic stability is obtained using an NLP based optimization strategy. A torque-based inverse dynamics control technique ensures that the quadruped follows the desired trajectory. The robot was simulated using Simscape Multibody, which utilizes the robot model’s “.stl,”“.step,” and “.xml” files to follow the optimized joint trajectories. The total energy consumed and joint torques are compared between the complaint and rigid link quadruped robots for walk on different types of terrain with different gaits and C-sections of 3, 4, 6, and 8 mm thickness. The simulation results show a significant reduction in joint torque spikes (more than 70% for all cases) due to the addition of compliance in each leg. This also leads to a reduction in total energy consumption during the walk especially over an uneven terrain. Hence, the results verify that the proposed design of quadruped is functionally more efficient than its rigid counterpart for walking on uneven terrain.