Ōki was born into a samurai family in Saga, in Hizen province (present-day Saga prefecture). He studied at the domain school Kodokan, and promoted reform of the domain administration. During the Boshin War he was a leader in the Saga forces committed to the overthrow of the Tokugawa shogunate.
In 1871, he became Education Minister and is credited with establishing Japan's modern educational system. In 1873, he became sangi (councillor) and in 1876, Justice Minister and was concerned with the punishment of the disgruntled ex-samurai involved in the Hagi Rebellion and the Shimpūren Rebellion. In 1880, he became chairman of the Genrōin . He also worked on developing Japan's civil code as the president of the ‘Civil Code Compiling Council’.
In 1884, he was elevated to the title of hakushaku (count) in the new kazoku peerage system.