First, Visit WhatsApp Business Page Register for WhatsApp Business API, and create a flow for the chat.
Then use a chat developer>follow your chatbot and put the API chatbot on your phone.
At the very next step, Get your OpenAI API from the Link here (secret key)
Now use OpenAI API to connect to the WhatsApp bot you created.
Note- However, this must be done at your own risk as there are chances of Whatsapp blocking you if it finds that the integration is not genuine.