 Ōi was a native of Chōshū Domain (present-day Yamaguchi Prefecture) and entered the Imperial Japanese Army Academy in 1881 and graduated from the Army War College in April 1887. he served in the Imperial Japanese Army General Staff Office from December 1889.In February 1890 he was sent to Germany for studies, and was attached to the Prussian Army's 113th Infantry Regiment.He was promoted to captain in December 1893, and returned to Japan in February 1895, where he was assigned to the staff of the IJA 2nd Army; however from May to December of that year he was assigned as an advisor to the Government-General of Taiwan.