As the leader of the Popular Party, in late December 1921 he formed a government where Fan S. Noli was the Minister of Foreign Affairs and Ahmed Zogu was the Minister of Internal Affairs.
From December 2, 1922, to January 31, 1925, Ypi was a member of the High Council (the collegial Head of State, formally for William of Wied).
In June 1924 he left Albania because of Noli's revolt, but he kept holding the post formally.
During Zogu's reign, Ypi was Chief Inspector of the Royal Court.
After King Zog had fled after Italian occupation, from April 9 to April 12 Ypi was Chairman and Plenipotentiary for Justice of the Provisional Administration Committee, and as such acting head of state.