Optimal gait cycles are generated for a seven-link biped using a parametric optimization method. A sagittal walking pattern, including a double-support phase divided into two sub-phases, is considered. Generalized joint coordinates are approximated by three-time differentiable spline-functions. These are the concatenation of 4-order polynomials linked together up to their third derivatives at connecting points — or knots — distributed along the motion time of each phase. Optimization parameters are the values of joint coordinates at the knots, plus the joint velocities, and possibly the joint accelerations, at transitions between successive phases. An integral amount of driving torques is minimized throughout the walking cycle. During the double support, constraint forces in the kinematically closed locomotion system are dealt with as additional actuating forces. For this reason, these are also minimized. Using the above optimization parameters, this basic optimal control problem is transformed into an optimization problem of mathematical programming. The latter is efficiently solved using a Sequential Quadratic Programming algorithm. The only kinematic data required for generating a gait cycle is the walking speed. Postural configurations between successive phases, step length, and relative length of single and double supports are optimized with respect to a given walking speed.