We study health-care provider agency and optimal payments, considering an expensive medication for dialysis patients. Using Medicare claims data we estimate a structural model of treatment decisions, in which providers differ in their altruism and marginal costs, and this heterogeneity is unobservable to the government. In a novel application of nonlinear pricing methods, we empirically characterize the optimal contracts in this environment. The optimal contracts eliminate medically excessive dosages and reduce expenditures, resulting in approximately $300 million in annual gains from better contracting. This approach could be applied to a broad class of problems in health-care payment policy. (JEL D64, D86, H51, I11, I13, J33, L21)