In this paper we present the pencil beam dose model used for treatment planning at the PSI proton gantry, the only system presently applying proton therapy with a beam scanning technique. The scope of the paper is to give a general overview on the various components of the dose model, on the related measurements and on the practical parametrization of the results. The physical model estimates from first physical principles absolute dose normalized to the number of incident protons. The proton beam flux is measured in practice by plane-parallel ionization chambers (ICs) normalized to protons via Faraday-cup measurements. It is therefore possible to predict and deliver absolute dose directly from this model without other means. The dose predicted in this way agrees very well with the results obtained with ICs calibrated in a cobalt beam. Emphasis is given in this paper to the characterization of nuclear interaction effects, which play a significant role in the model and are the major source of uncertainty in the direct estimation of the absolute dose. Nuclear interactions attenuate the primary proton flux, they modify the shape of the depth-dose curve and produce a faint beam halo of secondary dose around the primary proton pencil beam in water. A very simple beam halo model has been developed and used at PSI to eliminate the systematic dependences of the dose observed as a function of the size of the target volume. We show typical results for the relative (using a CCD system) and absolute (using calibrated ICs) dosimetry, routinely applied for the verification of patient plans. With the dose model including the nuclear beam halo we can predict quite precisely the dose directly from treatment planning without renormalization measurements, independently of the dose, shape and size of the dose fields. This applies also to the complex non-homogeneous dose distributions required for the delivery of range-intensity-modulated proton therapy, a novel therapy technique developed at PSI.