Well, it depends on how cheap you want to go and what is your goal to learn the piano.
To play the piano itself, don’t buy anything without at least weighted-keys, if possible with hammer action keys (much closer to an actual piano).
You will be able to learn the basics on anything that looks like a keyboard (even a cardboard keyboard with false keys drawn on it!) but you won’t be able to learn how to play with dynamics. The problem is then that you will have to learn again when you go to a piano and you may be very frustrated by what you can achieve on a cheap keyboard.
I practiced my very first lessons playing on a table but I could also play on my teacher’s acoustic piano during my lessons.
You can find a decent brand new digital piano for about $250.
But you can certainly find good ones in classified ads (like Gumtree here in the UK), or ebay.
To help you make a good choice, I would recommend that you have a look at the piano buying guide I wrote here.
But, if you want to have a keyboard to play different sounds, record yourself as a complement to your other instruments, you can go for a cheap MIDI keyboard for example.
Again, you can check out this guide on MIDI keyboards.
In the end, how important is it for you to play the piano?
Often, a budget is a matter of choice. I know what it is not to have a budget, but sometimes it comes down to financial choices. Another topic 😉
So to answer your question “Is it ok to buy a cheap keyboard just to start learning how to play the piano?”, you have to ask yourself those questions to start with:
- Why do you want to learn the piano?
- What music genre do you want to play?
- How important is it for you?
I hope that my pointers will help you to make the right choice.