  Air shower experiments have detected cosmic ray events of energies upto 300
EeV. Most likely these cosmic rays have originated from compact objects. Their
exact sources are yet to be identified. It has been suggested before that gamma
ray bursts are possible sources of ultra-high energy cosmic rays. The two
models of gamma ray burst emissions most often discussed are the internal and
external shock models. We have calculated the proton spectrum above 60EeV from
all gamma ray bursts distributed upto a redshift of 0.02 in the internal shock
model assuming redshift and luminosity distributions consistent with
observations, log normal distributions for their values of Lorentz factors,
variability times and duration of bursts. Within the external shock model we
have calculated the proton flux above 60EeV from all nearby gamma ray bursts
assuming log normal distributions in their values of total energies, Lorentz
factors at the deceleration epoch and compared with the observed data. We find
that gamma ray bursts can produce cosmic ray proton flux comparable to the flux
observed by the Pierre Auger experiment both within the internal and external
shock models. We have also studied the dependence of the maximum proton
energies and the cooling breaks in the proton spectrum on the various
parameters like Lorentz factor, energy of the GRB fireball, variability time
(in case of internal shocks), ambient particle density (in case of external
shocks). Our results are important to understand how the various observable
parameters determine which mechanism e.g. $p\gamma$ interactions, synchrotron
cooling of protons will dominate over one another inside these sources.
