To improve the aircraft's flight safety under the presence of turbulence, 4D (3D space plus time) trajectories optimization which based on pseudo-spectral method was proposed. Considered the characteristic of the 4D trajectories optimization for turbulence avoidance, aircraft dynamic model and turbulent Gaussian distribution model were elaborated, at the same time, the objective function and constraints were designed. Through numerical simulations, 4D trajectories for turbulence avoidance can be generated accurately using the proposed algorithm.