It helps to write the full action:
$$S = \int \frac{-mc^2}{\gamma}dt - \int U dt $$
The first term can be put in a much better form by noting that $d\tau = \frac{dt}{\gamma}$ represents the proper time for the particle. The action is then:
$$S = -mc^2\int d\tau - \int U dt$$
The first term is Lorentz invariant, being only the distance between two points given by the Minkowski metric, and is good in relativity. The second term however, isn't (assuming that $U$ is a scalar); there is no way it can be a relativistic action.
There are two easy ways out:
- The first is simply to change the term to $\frac{U}{\gamma}$. This gives the action:
$$S = -\int (mc^2+U)d\tau$$
- The second is to "promote" the term (a terminology used in Zee's Einstein Gravity in a Nutshell) to a relativistic dot product, giving the action:
$$S = -mc^2\int d\tau - \int U_\mu dx^{\mu}$$
The former has no real world classical analog (that I know of), and the latter is more or less the interaction of a particle with a static electromagnetic field. But the original form is recovered from the latter when the spatial components of $U_\mu$ vanish, leaving only $U_0$.
The kinetic energy is obtained by transforming the Lagrangian to the Hamiltonian (see here).