The lateral response of pile foundations in sand is commonly analyzed using p-y elements attached to the pile, typically using the API sand p-y relationship. The API relationship was developed for static loading conditions, with cyclic correction factors intended to represent degradation due to many slow loading cycles. However, the API model is often applied for dynamic loading conditions (e.g., earthquake shaking) because suitable alternatives have not been formulated. This study demonstrates that the API sand functional form is inappropriate for dynamic analysis of piles, and presents a new functional form that better captures the nonlinear p-y behavior of piles in sand during earthquake loading. The new functional form is in the process of being implemented in OpenSees, an open source finite element modeling platform that is freely available to users.