Nickel-Titanium (NiTi) endodontic files have emerged as valuable tools for root canal treatment due to their high strength and flexibility. During treatment, the files are rotated in the bent configuration of the root canal, which leads to cyclic nonproportional loading. With the goal of understanding the mechanical response of NiTi endodontic files and to allow for an enhanced design of these structures, a constitutive model for shape memory alloys is developed. This model incorporates several of the features present in SMAs relevant for the mechanical response of endodontic files including: transformation, reorientation, yield plasticity, functional fatigue, tension-compression asymmetry and internal loops. The model is implemented in Ansys using a small strain formulation and extended to finite strains using the nonlinear geometry algorithm in Ansys. Validation of the model is performed by simulating a cyclic torsional experiment from the literature using a simplified file geometry. Finally, the model is applied to simulate a simplified file under torsional rotation in a bent configuration. The results illustrate that the endodontic file develops a torsional oscillation during the course of the cyclic loading, which is directly associated with an increase in residual stresses. Furthermore, the torsional oscillation leads to higher values of the martensite volume fraction and stress.