Afriat (1967) showed the equivalence of the strong axiom of revealed preference and the existence of a solution to a set of linear inequalities. From this solution he constructed a utility function rationalizing the choices of a competitive consumer. We extend Afriat's theorem to a class of nonlinear budget sets. We thereby obtain testable implications of rational behavior for a wide class of economic environments, and a constructive method to derive individual preferences from observed choices. In an application to market games, we identify a set of observable restrictions characterizing Nash equilibrium outcomes.