Context : The cosmological origin of Gamma-Ray Bursts ( GRBs ) has been firmly established , with redshifts up to z = 6.29 . GRBs are possible candidates to be used as “ distance indicators ” to test cosmological models in a redshift range hardly achievable by other cosmological probes . Asserting the validity of the empirical relations among GRB observables is now crucial for their calibration . Aims : Motivated by the relation proposed by Amati and collaborators , we look within the “ fireshell ” model for a relation between the peak energy E _ { p } of the \nu F _ { \nu } total time-integrated spectrum of the afterglow and the total energy of the afterglow E _ { aft } , which in our model encompasses and extends the prompt emission . Methods : The fit within the fireshell model , as for the “ canonical ” GRB050315 , uses the complete arrival time coverage given by the Swift satellite . It is performed simultaneously , self-consistently and recursively in the four BAT energy bands ( 15 – 25 keV , 25 – 50 keV , 50 – 100 keV and 100 - 150 keV ) as well as in the XRT one ( 0.2 – 10 keV ) . It uniquely determines the two free parameters characterizing the GRB source , the total energy E ^ { e ^ { \pm } } _ { tot } of the e ^ { \pm } plasma and its baryon loading B , as well as the effective CircumBurst medium ( CBM ) distribution . We can then build two sets of “ gedanken ” GRBs varying the total energy of the electron-positron plasma E ^ { e ^ { \pm } } _ { tot } and keeping the same baryon loading B of GRB050315 . The first set assumes for the effective CBM density the one obtained in the fit of GRB050315 . The second set assumes instead a constant CBM density equal to the average value of the GRB050315 prompt phase . Results : For the first set of “ gedanken ” GRBs we find a relation E _ { p } \propto ( E _ { aft } ) ^ { a } , with a = 0.45 \pm 0.01 , whose slope strictly agrees with the Amati one . Such a relation , in the limit B \to 10 ^ { -2 } , coincides with the Amati one . Instead , in the second set of “ gedanken ” GRBs no correlation is found . Conclusions : Our analysis excludes the Proper-GRB ( P-GRB ) from the prompt emission , extends all the way to the latest afterglow phases and is independent on the assumed cosmological model , since all “ gedanken ” GRBs are at the same redshift . The Amati relation , on the other hand , includes also the P-GRB , focuses on the prompt emission only , and is therefore influenced by the instrumental threshold which fixes the end of the prompt emission , and depends on the assumed cosmology . This may well explain the intrinsic scatter observed in the Amati relation .