WhatsApp Chatbot with ChatGPT

Building a chatbot can be a fun and rewarding project. In this guide, we will walk you through the process of building a chatbot for WhatsApp using OpenAI and Ultramsg.

Step 1: Obtain The OpenAI API Key

To obtain an API key for the OpenAI API, you will need to sign up for a free OpenAI account on the OpenAI website (https://openai.com/):

After opening the account Go to ( https://beta.openai.com/account/api-keys ) and click on the “Create new secret Key” button, Save it for later use in step 2.

Step 2: Activate and set the webhook in Ultramsg

you need to enable Webhook on Received option and Put the following link in the Webhook URL in Ultramsg.


do not forget to change the parameters instance_id & token & gpt_api_key.

instance_id = your instance id in Ultramsg like instance950.

token = Token for your instance in Ultramsg.

gpt_api_key = GPT API-KEY you got from Openai in the first step.

image 1

Congratulations, That’s it. now you can make conversation with With the WhatsApp number linked to your instance.