We propose a general method for deriving one-dimensional models for nonlinear structures. It captures the contribution to the strain energy arising not only from the macroscopic elastic strain as in classical structural models, but also from the strain gradient. As an illustration, we derive one-dimensional strain-gradient models for a hyper-elastic cylinder that necks, an axisymmetric membrane that produces bulges, and a two-dimensional block of elastic material subject to bending and stretching. The method offers three key advantages. First, it is nonlinear and accounts for large deformations of the cross-section, which makes it well suited for the analysis of localization in slender structures. Second, it does not require any a priori assumption on the form of the elastic solution in the cross-section, i.e., it is Ansatz-free. Thirdly, it produces one-dimensional models that are asymptotically exact when the macroscopic strain varies on a much larger length scale than the cross-section diameter. (C) 2019 Elsevier Ltd. All rights reserved.