This study presents a gradient-based method, TPAA-TR, for optimizing structures under earthquake excitation. The method develops an efficient algorithm that can converge quickly to the optimal solution under time history loading. It uses two-point exponential approximation with consistent intermediate variables to construct explicit linear sub-problems, and applies filter method and trust region strategy to solve them. Merit functions and filters are used to balance the trade-off between reducing objectives and satisfying constraints, and promote convergence. The method performs nonlinear response history analysis for seismic analysis to account for the nonlinear behavior of structures. The effectiveness of the proposed method is demonstrated by three numerical examples: a three-story shear frame, a six-story frame installed with nonlinear devices and a nine-story three-dimensional (3D) reinforced concrete (RC) nonlinear building. The results show that the proposed method can achieve optimal solutions with less computational time and fewer function evaluations than existing methods.