The oxidation state of Os in OsO₄ is +8.
The electron configuration of Os is [Xe]6s²4f¹⁴5d⁶.
The 4f electrons are inner electrons, so Os has eight valence electrons — 6s²5d⁶.
Since O is more electronegative than Os, The Os "loses" all these electrons to the O.
So, its oxidation state is +8.