This paper introduces output feedback distributed optimization algorithms designed specifically for second‐order nonlinear multi‐agent systems. The agents are allowed to have heterogeneous dynamics, characterized by distinct nonlinearities, as long as they satisfy the Lipschitz continuity condition. For the case with unknown states, nonlinear state observers are designed first for each agent to reconstruct agents' unknown states. It is proven that the agents' unknown states are estimated accurately by the developed state observers. Then, based on the agents' state estimates and the gradient of each agent local cost function, a kind of output feedback distributed optimization algorithms are proposed for the considered multi‐agent systems. Under the proposed distributed optimization algorithms, all the agents' outputs asymptotically approach the minimizer of the global cost function which is the sum of all the local cost functions. By using Lyapunov stability theory, convex analysis, and input‐to‐state stability theory, the asymptotical convergence of the output feedback distributed optimization closed‐loop system is proven. Simulations are conducted to validate the efficacy of the proposed algorithms.