Stochastic boundary conditions for interactions with a particle reservoir are discussed in manyparticle systems. We introduce the boundary conditions with the injection rate and the momentum distribution of particles coming from a particle reservoir in terms of the pressure and the temperature of the reservoir. It is shown that equilibrium ideal gases and hard-disk systems with these boundary conditions reproduce statistical-mechanical properties based on the corresponding grand canonical distributions. We also apply the stochastic boundary conditions to a hard-disk model with a steady particle current escaping from a particle reservoir in an open tube, and discuss its nonequilibrium properties such as a chemical potential dependence of the current and deviations from the local equilibrium hypothesis.