The story
Unknown, but attributed to US carnival slang (carny), usually as a purposefully obscure variant of the admonition “be fake” formed through backslang or mangled pig Latin. Also sometimes attributed to an alteration of cave (Latin for “beware”), keep cavey (“stay alert”), or an eponymous figure named Kay Fabe or Kay Fabian.
Etymology from Wiktionary, CC BY-SA 4.0.