It could be do to anxiety and stress. Has there been any big changes in your life? Try relaxing before going to sleep, taking a warm bath, or a walk outside.
It could be the anxiety medication. Most anxiety medication have insomnia listed as a common side effect. General side effects are mostly present during the first 1-4 weeks while the body adapts to the drug.
If it continues and gets any worst, tell your doctor about it.