The correct word is "atau" for standard Indonesian writing.
So, how come it becomes "apa" to replace "atau"
Here is the explanation.
Actually, it is from:
Apakah dia itu laki-laki atau apakah dia itu perempuan?
So, to shorten it in daily speaking, we say:
Dia itu laki-laki apa perempuan?
btw, "cowok" and "cewek" are informal.
Hope this will help you.