A compound of formula or a pharmaceutically acceptable salt thereof, wherein: R 1 and R 2 are independently selected from hydrogen, C 3 -C 6 cycloalkyl, and C 1 -C 3 alkyl wherein the C 1 -C 3 alkyl is optionally substituted with one, two, or three groups independently selected from C 1 -C 3 alkoxy, C 1 -C 3 alkylamino, amino, cyano, C 1 -C 3 dialkylamino, halo, and hydroxy; or R 1 and R 2 together are oxo; R 3 is selected from C 1 -C 6 alkoxy, C 2 -C 6 alkynyl, amino, C 3 -C 6 cycloalkyl optionally substituted with C 1 -C 3 alkyl or cyano, C 3 -C 6 cycloalkylamino, piperidinyl optionally substituted with C 1 -C 6 alkyl, C 1 -C 3 alkyl-Y, and C 1 -C 8 salkyl, wherein the C 1 -C 8 salkyl is optionally substituted with one, two, or three groups independently selected from C 1 -C 3 alkoxy, C 1 -C 3 alkylamino, C 1 -C 3 alkoxyC 2 -C 3 alkylamino, C 1 -C 3 alkoxycarbonyl, amino, aminosulfonyl, aryl, cyano, C 1 -C 3 dialkylamino, halo, C 1 -C 3 haloalkylamino, C 1 -C 3 haloalkylcarbonylamino, hydroxy, -NR x R y, and C 3 -C 8 cycloalkyl, wherein the cycloalkyl is further optionally substituted with one, two, or three groups independently selected from C 1 -C 3 alkoxy, C 1 -C 3 alkyl, C 1 -C 3 alkylamino, C 1 -C 3 alkoxyC 2 -C 3 alkylamino, amino, aryl, arylC 1 -C 3 alkyl, halo, C 1 -C 3 haloalkyl, C 1 -C 3 haloalkylamino and hydroxy; R 4 is selected from hydrogen, C 1 -C 3 alkoxy, C 1 -C 3 alkoxycarbonylamino, C 1 -C 3 alkyl, C 1 -C 3 alkylamino, C 1 -C 3 alkylcarbonylamino, amino, arylamino, arylcarbonylamino, C 3 -C 6 cycloalkylamino, C 3 -C 6 cycloalkylcarbonylamino, C 3 -C 6 cycloalkyloxy, halo, C 1 -C 3 haloalkoxy, C 1 -C 3 haloalkyl, C 2 -C 3 haloalkylamino, C 2 -C 3 haloalkylcarbonylamino, and hydroxy; R 5 is selected from hydrogen, C 1 -C 3 alkyl, cyano, C 3 cycloalkyl, and halo; R x and R y, together with the nitrogen atom to which they are attached, form a three- to six-member ring optionally substituted with oxo; and Y is selected from wherein R 6 is selected from hydrogen, C 1 -C 6 alkyl, C 3 -C 6 cycloalkyl, and C 1 -C 6 alkylcarbonyl; n is 0, 1, 2, or 3; each R 7 is independently selected from hydrogen, C 1 -C 6 alkyl, aryl, arylC 1 -C 3 alkyl, C 3 -C 6 cycloalkyl, halo, and C 1 -C 3 haloalkyl; each R 8 is independently selected from hydrogen, C 1 -C 3 alkoxy and hydroxy; and R 9 and R 10 are each hydrogen or together form an oxo group. R 1 and R 2 are independently selected from hydrogen, C 3 -C 6 cycloalkyl, and C 1 -C 3 alkyl wherein the C 1 -C 3 alkyl is optionally substituted with one, two, or three groups independently selected from C 1 -C 3 alkoxy, C 1 -C 3 alkylamino, amino, cyano, C 1 -C 3 dialkylamino, halo, and hydroxy; or R 1 and R 2 together are oxo; R 3 is selected from C 1 -C 6 alkoxy, C 2 -C 6 alkynyl, amino, C 3 -C 6 cycloalkyl optionally substituted with C 1 -C 3 alkyl or cyano, C 3 -C 6 cycloalkylamino, piperidinyl optionally substituted with C 1 -C 6 alkyl, C 1 -C 3 alkyl-Y, and C 1 -C 8 salkyl, wherein the C 1 -C 8 salkyl is optionally substituted with one, two, or three groups independently selected from C 1 -C 3 alkoxy, C 1 -C 3 alkylamino, C 1 -C 3 alkoxyC 2 -C 3 alkylamino, C 1 -C 3 alkoxycarbonyl, amino, aminosulfonyl, aryl, cyano, C 1 -C 3 dialkylamino, halo, C 1 -C 3 haloalkylamino, C 1 -C 3 haloalkylcarbonylamino, hydroxy, -NR x R y, and C 3 -C 8 cycloalkyl, wherein the cycloalkyl is further optionally substituted with one, two, or three groups independently selected from C 1 -C 3 alkoxy, C 1 -C 3 alkyl, C 1 -C 3 alkylamino, C 1 -C 3 alkoxyC 2 -C 3 alkylamino, amino, aryl, arylC 1 -C 3 alkyl, halo, C 1 -C 3 haloalkyl, C 1 -C 3 haloalkylamino and hydroxy; R 4 is selected from hydrogen, C 1 -C 3 alkoxy, C 1 -C 3 alkoxycarbonylamino, C 1 -C 3 alkyl, C 1 -C 3 alkylamino, C 1 -C 3 alkylcarbonylamino, amino, arylamino, arylcarbonylamino, C 3 -C 6 cycloalkylamino, C 3 -C 6 cycloalkylcarbonylamino, C 3 -C 6 cycloalkyloxy, halo, C 1 -C 3 haloalkoxy, C 1 -C 3 haloalkyl, C 2 -C 3 haloalkylamino, C 2 -C 3 haloalkylcarbonylamino, and hydroxy; R 5 is selected from hydrogen, C 1 -C 3 alkyl, cyano, C 3 cycloalkyl, and halo; R x and R y, together with the nitrogen atom to which they are attached, form a three- to six-member ring optionally substituted with oxo; and Y is selected from wherein R 6 is selected from hydrogen, C 1 -C 6 alkyl, C 3 -C 6 cycloalkyl, and C 1 -C 6 alkylcarbonyl; n is 0, 1, 2, or 3; each R 7 is independently selected from hydrogen, C 1 -C 6 alkyl, aryl, arylC 1 -C 3 alkyl, C 3 -C 6 cycloalkyl, halo, and C 1 -C 3 haloalkyl; each R 8 is independently selected from hydrogen, C 1 -C 3 alkoxy and hydroxy; and R 9 and R 10 are each hydrogen or together form an oxo group.