 He served as member of the State house of representatives 1843–1845.He served as captain in the Third Kentucky Volunteers in the Mexican War in 1847.Cox was elected as a Whig to the Thirty-third Congress and as a candidate of the American Party to the Thirty-fourth Congress (March 4, 1853 – March 3, 1857).