The imaging and spectroscopy of habitable worlds will require large-aperture space-based telescopes, to increase the collecting area and the angular resolution. These large telescopes will necessarily use segmented primaries to fit in a rocket. However, these massively segmented mirrors make high-contrast performance very difficult to achieve and stabilize, compared with more common monolithic primaries. Despite space telescopes operating in a friendlier environment than ground-based telescopes, remaining vibrations and resonant modes on the segments can still deteriorate the performance. In this context, we present the Pair-based Analytical model for Segmented Telescopes Imaging from Space (PASTIS) that enables the establishment of a comprehensive error budget, both in terms of segment alignment and stability. Using this model, one may evaluate the influence of the segment cophasing and surface quality evolution on the final images and contrasts, and set up requirements for any given mission. One can also identify the dominant modes of a given geometry for a given coronagraphic instrument and design the feedback control systems accordingly. We first develop and validate this analytical model by comparing its outputs to the images and contrasts predicted by an end-to-end simulation. We show that the contrasts predicted using PASTIS are accurate enough compared with the end-to-end propagation results, at the exo-Earth detection level. Second, we develop a method for a fast and efficient error budget in terms of segment manufacturing and alignment that takes into account the disparities of the segment effects on the final performance. This technique is then applied on a specific aperture to provide static and quasistatic requirements on each segment for local piston and 45-deg astigmatism aberrations. Finally, we discuss potential application of this technique to future missions.