>So where'd the spelled-out version come from?

of course it's just a representation of the pronunciation -- Mencken in The American Language wrote "Woodrow Wilson is said... to use okeh in endorsing government papers." (E. Waugh spelt it "okey" in Brideshead Revisited.

Mencken, incidentally, discusses the origin of O.K. at length, presenting no less than ten possible etymologies and suggesting that it must have been in familiar use before 1840 (the date of the oll korrect story). in fact, the okeh spelling supposedly stems from a Choctaw word signifying "it is so", which is where Wilson picked it up for approving official papers!