Oxytocin neurons of the rat hypothalamus project to the posterior pituitary, where they secrete their products into the bloodstream. The pattern and quantity of that release depends on the afferent inputs to the neurons, on their intrinsic membrane properties, and on nonlinear interactions between spiking activity and exocytosis: A given number of spikes will trigger more secretion when they arrive close together. Here we present a quantitative computational model of oxytocin neurons that can replicate the results of a wide variety of published experiments. The spiking model mimics electrophysiological data of oxytocin cells responding to cholecystokinin (CCK), a peptide produced in the gut after food intake. The secretion model matches results from in vitro experiments on stimulus-secretion coupling in the posterior pituitary. We mimic the plasma clearance of oxytocin with a two-compartment model, replicating the dynamics observed experimentally after infusion and injection of oxytocin. Combining these models allows us to infer, from measurements of oxytocin in plasma, the spiking activity of the oxytocin neurons that produced that secretion. We have tested these inferences with experimental data on oxytocin secretion and spiking activity in response to intravenous injections of CCK. We show how intrinsic mechanisms of the oxytocin neurons determine this relationship: In particular, we show that the presence of an afterhyperpolarization (AHP) in oxytocin neurons dramatically reduces the variability of their spiking activity and even more markedly reduces the variability of oxytocin secretion. The AHP thus acts as a filter, protecting the final product of oxytocin cells from noisy fluctuations.