We present a systematic analysis of the X-ray spectra of NGC 1313 X-1 and NGC 1313 X-2, using three years of XMM–Newton observations. We fitted the continuum with a Comptonization model plus a multicolour blackbody disc, which describes the effects of an accretion disc plus a corona. We checked the consistency of this spectral model on the basis of the variability patterns of its spectral parameters. We found that the two sources show different spectral states. We tentatively interpret the observed behaviour of NGC 1313 X-1 and X-2 within the framework of near-Eddington and/or super-Eddington accretion. We also attempted to determine the chemical abundances in the local environment of NGC 1313 X-1 and X-2 from the EPIC and RGS spectra. The results appear to indicate subsolar metallicity for both sources.