We consider the viability of dark energy (DE) models in the framework of the scalar-tensor theory of gravity, including the possibility to have a phantom DE at small redshifts z as admitted by supernova luminosity-distance data. For small z, the generic solution for these models is constructed in the form of a power series in z without any approximation. Necessary constraints for DE to be phantom today and to cross the phantom divide line p = −ρ at small z are presented. Considering the Solar System constraints, we find for the postNewtonian parameters that γ P N < 1 and γ P N,0 ≈ 1 for the model to be viable, and β P N,0 > 1 (but very close to 1) if the model has a significantly phantom DE today. However, prospects to establish the phantom behaviour of DE are much better with cosmological data than with Solar System experiments. Earlier obtained results for a Λ-dominated universe with the vanishing scalar field potential are extended to a more general DE equation of state confirming that the cosmological evolution of these models rule them out. Models of currently fantom DE which are viable for small z can be easily constructed with a constant potential; however, they generically become singular at some higher z. With a growing potential, viable models exist up to an arbitrary high redshift.