---
title: "WhatsApp ChatGPT Bot: How to Build One (2026 Guide)"
description: How to build a ChatGPT-powered WhatsApp chatbot with webhooks and OpenAI, what Meta's 2026 rules allow, human handoff, and what it costs to run.
image: https://haber.chat/hubfs/blog-featured-images/whatsapp-chatgpt-bot.jpeg
---

[Skip to content](https://haber.chat/blog/whatsapp-chatgpt-bot#main-content)

[![haber-chat-high-resolution-logo - Copy-1](https://haber.chat/hs-fs/hubfs/haber-chat-high-resolution-logo%20-%20Copy-1.png?width=120&height=117&name=haber-chat-high-resolution-logo%20-%20Copy-1.png "haber-chat-high-resolution-logo - Copy-1")](https://haber.chat/)

[launch your Free Trial](https://haber.chat/signup-gateway)

- [Pricing](https://haber.chat/pricing)
- [Quick start](https://haber.chat/quick-start)
- [Help Center](https://app.haber.chat/help)
- [Reviews and badges](https://haber.chat/blog/whatsapp-chatgpt-bot#reviews)

Open main navigation

Close main navigation

- [Pricing](https://haber.chat/pricing)
- [Quick start](https://haber.chat/quick-start)
- [Help Center](https://app.haber.chat/help)
- [Reviews and badges](https://haber.chat/blog/whatsapp-chatgpt-bot#reviews)

[Follow us on YouTube](https://www.youtube.com/channel/UCzYcDckdCetQtXFxNZ33qNQ) [Follow us on LinkedIn](https://www.linkedin.com/company/haberchat/)

 Nov 11, 2026, 10:00:00 AM

# How to Build a ChatGPT-Powered WhatsApp Chatbot

![Picture of HaberChat Team](https://haber.chat/hs-fs/hubfs/haber-chat-high-resolution-logo%20-%20Copy-1.png?width=50&name=haber-chat-high-resolution-logo%20-%20Copy-1.png) [HaberChat Team](https://haber.chat/blog/author/haberchat-team)

Share: [facebook-f icon](http://www.facebook.com/share.php?u=https://haber.chat/blog/whatsapp-chatgpt-bot) [linkedin-in icon](http://www.linkedin.com/shareArticle?mini=true&url=https://haber.chat/blog/whatsapp-chatgpt-bot) [Twitter icon](https://twitter.com/intent/tweet?url=https://haber.chat/blog/whatsapp-chatgpt-bot) [pinterest-p icon](http://pinterest.com/pin/create/link/?url=https://haber.chat/blog/whatsapp-chatgpt-bot) [envelope icon](mailto:?body=https://haber.chat/blog/whatsapp-chatgpt-bot)

To build a ChatGPT-powered WhatsApp chatbot, you connect your number to a platform that sends each incoming message to a webhook. A small program passes the message to OpenAI's API with your instructions, then sends the answer back through the platform's API. With HaberChat, an open-source Node.js bot does this for you. You add two API keys, write the bot's instructions and run it.

Before you build, make sure a bot is what you need. Many teams only want AI that helps their agents reply faster, and that needs no code at all. Platform rules below were checked against Meta's terms and developer docs on October 15, 2026.

## Three ways to put ChatGPT-style AI on WhatsApp

| Approach | Who replies | Code needed | Best for |
| --- | --- | --- | --- |
| **AI assistant in the inbox** | Your agents, with AI-suggested replies | None | Faster, better human replies |
| **MCP from ChatGPT or Claude** | You, by telling the AI what to send | None | Running your own WhatsApp from an AI chat |
| **A custom chatbot** | The bot, automatically, until a human takes over | Some (Node.js) | Answering common questions around the clock |

HaberChat's AI assistant is on the Business and Enterprise plans. It drafts replies based on the conversation, translates, fixes tone and grammar, and transcribes voice notes. It doesn't need your own OpenAI account. For the MCP route, see [how to connect WhatsApp to Claude or ChatGPT](https://haber.chat/blog/whatsapp-mcp). The rest of this post covers the third option.

## Is a ChatGPT bot allowed on WhatsApp?

Yes, for your own business's customer conversations. Meta's terms for the WhatsApp Business Platform, section 4.7, bar AI providers whose AI is the main product being offered, such as a general-purpose assistant anyone can chat with. AI that's incidental to your business, like a support bot that answers questions about your orders or bookings, isn't the target.

Keep the bot on your business topics, say it's an automated assistant, and always offer a person. If you connect your number by QR code rather than the API, remember that's not an official Meta integration, and WhatsApp's anti-spam rules still apply. A bot should only reply to people who message you. Never use one for cold outreach.

## What you need

- A WhatsApp or WhatsApp Business number connected to HaberChat.
- A HaberChat API key, from your dashboard.
- An OpenAI API key. OpenAI bills API usage separately from ChatGPT subscriptions.
- Node.js installed on your computer or a server.
- For testing on your own computer, a free ngrok account so WhatsApp events can reach your machine.

## How the bot works

1. A customer messages your number.
2. HaberChat sends the message to the bot's webhook.
3. The bot checks whether it should answer. It skips group chats, chats already assigned to an agent, chats with labels you've excluded, numbers on your block list, and archived or blocked contacts.
4. It sends the recent conversation and your instructions to OpenAI.
5. It posts the answer back to the customer through the HaberChat API.

Because the bot reads earlier messages in the chat, its answers follow the conversation instead of treating every message on its own.

## Step by step

1. **Download the bot** from our [ChatGPT chatbot tutorial](https://app.haber.chat/help/chatbot-ai) and install its dependencies with npm.
2. **Add your keys** to the configuration file: your HaberChat API key and your OpenAI API key.
3. **Pick a model.** The configuration sets the OpenAI model, and smaller models cost less per message.
4. **Write the instructions.** This is the bot's job description, covered below.
5. **Set the welcome and fallback messages**, including what it says when it gets something it can't read.
6. **Run it.** On your computer, the bot opens an ngrok tunnel and registers the webhook automatically. On a server, give it your public HTTPS address instead.
7. **Test from another phone.** Ask the questions your customers really ask, and try to push it off topic.

## Writing instructions that keep the bot on track

The instructions decide most of the bot's quality. Keep them short and concrete:

- Say who it is and which business it works for.
- List what it may help with, such as opening hours, prices, delivery times and order status.
- Tell it to politely decline anything unrelated.
- Tell it never to invent prices, policies or availability, and to hand over when it isn't sure.
- Set the tone, and keep answers to a few sentences, because long replies read badly on a phone.

The bot can also call your own functions to fetch live data, such as an order's status from your system. That's far more reliable than pasting facts into the instructions and hoping they stay current.

## Handing off to a person

Customers can type "human" to reach your team. The bot then assigns the chat to an available agent and stops replying in it. Agents can also take over any chat by assigning it to themselves. If a chat is unassigned later, the bot picks it up again.

To keep the bot out of certain chats for good, add a label you've excluded in the configuration, such as VIP customers. Pair the bot with clear [auto-reply messages](https://haber.chat/blog/whatsapp-auto-reply-examples) for after-hours, so people know when a person will be back.

## What it costs to run

- **OpenAI:** billed per token by OpenAI, so cost grows with conversation length and the model you choose.
- **Meta:** if your number is on the Cloud API, every bot reply is a billable message. Since October 1, 2026, Meta charges for replies inside the 24-hour window at the utility rate. On a QR connection there are no Meta message fees. See [WhatsApp API pricing](https://haber.chat/blog/whatsapp-api-pricing).
- **Hosting:** a small server if you want the bot running when your computer is off.
- **HaberChat:** your plan, from $47.40 a month per number (checked October 15, 2026).

## Frequently asked questions

### Can I connect ChatGPT to my WhatsApp Business number?

Yes. Connect the number to a platform with webhooks and an API, such as HaberChat, and run a bot that sends incoming messages to OpenAI and posts the answers back.

### Does Meta allow AI chatbots on WhatsApp?

Meta's terms bar AI providers whose AI is the main product, like general-purpose assistants. A business using a bot for its own customer support, where the AI is incidental, isn't the target.

### Do I need to code to build a WhatsApp ChatGPT bot?

A little. Our Node.js bot is ready to run once you add your keys and instructions. If you'd rather not code, HaberChat's AI assistant suggests replies for your agents instead.

### How does the bot hand a chat to a person?

The customer types "human" and the bot assigns the chat to an available agent, then stops replying. Assigning a chat to an agent manually does the same.

## Try HaberChat free for 7 days

No credit card needed. Connect your number, grab your API key and test a bot on your own chats. [**Start your free trial**](https://haber.chat/signup-gateway) or [compare plans](https://haber.chat/pricing).

---

# Please review us

- [![Capterra](https://haber.chat/hubfs/Capterra_idklDhE-0H_1.svg)](https://www.capterra.com/p/10021255/Haber-Chat/)
- [![GetApp](https://haber.chat/hs-fs/hubfs/getapp-logo-freelogovectors.net_-400x74.png?width=400&height=74&name=getapp-logo-freelogovectors.net_-400x74.png)](https://www.getapp.com/customer-service-support-software/a/haber-chat/)
- [![Trustpilot](https://haber.chat/hubfs/trustpilot-1.svg)](https://www.trustpilot.com/review/haber.chat)
- [![SourceForge](https://haber.chat/hubfs/SourceForge_idm9sDiPJq_1.svg)](https://sourceforge.net/software/product/Haber-Chat/)
- [![Slashdot](https://haber.chat/hubfs/slashdot-wordmark-1%20(1).svg)](https://slashdot.org/software/p/Haber-Chat/?pk_campaign=badge&pk_source=vendor)
- [![G2](https://haber.chat/hubfs/G2_idHMZFC-AU_1.svg)](https://www.g2.com/products/haberchat/reviews)
- [![Google my business reviews](https://haber.chat/hs-fs/hubfs/6293833130fb025780ee2967.png?width=800&height=450&name=6293833130fb025780ee2967.png)](https://g.page/r/CROTBwVmm03HEAI/review)
- [![Product Hunt](https://haber.chat/hs-fs/hubfs/Product%20Hunt.png?width=3085&height=556&name=Product%20Hunt.png)](https://www.producthunt.com/posts/haber-chat)
- [![Clutch](https://haber.chat/hs-fs/hubfs/clutch-co-vector-logo.png?width=900&height=500&name=clutch-co-vector-logo.png)](https://review.clutch.co/review?provider_id=ba7679d6-8470-47c0-8401-dc0c8fdda76d)

---

# Security scanned by

- [![Norton Site Seal](https://haber.chat/hs-fs/hubfs/Imported%20sitepage%20images/nortonsiteseal_exlg.png?width=259&height=139&name=nortonsiteseal_exlg.png)](https://safeweb.norton.com/report?url=haber.chat)
- [![Google Safe Browsing](https://haber.chat/hs-fs/hubfs/Google%20Safe%20Browsing.webp?width=585&height=210&name=Google%20Safe%20Browsing.webp)](https://transparencyreport.google.com/safe-browsing/search?url=haber.chat&hl=en)
- [![SSL Trust](https://haber.chat/hubfs/ssltrust-logo.svg)](https://www.ssltrust.com.au/security-report?domain=haber.chat)
- [![WOT](https://haber.chat/hs-fs/hubfs/WOT.png?width=292&height=128&name=WOT.png)](https://www.mywot.com/scorecard/haber.chat?wot_badge=1_white)
- [![Immuniweb](https://haber.chat/hubfs/logo-immuniweb.svg)](https://www.immuniweb.com/websec/haber.chat/1kTKMjXf/)
- [![SiteLock](https://haber.chat/hubfs/sitelock%20logo.svg)](https://www.sitelock.com/free-website-scan/?domain=haber.chat)
- [![Sucuri](https://haber.chat/hubfs/Sucuri.svg)](https://sitecheck.sucuri.net/results/haber.chat)
- [![Experte.com](https://haber.chat/hubfs/experte-com-logo.avif)](https://www.experte.com/security-check?d=haber.chat)
- [![Kaspersky](https://haber.chat/hs-fs/hubfs/web-logo-kaspersky.png?width=595&height=148&name=web-logo-kaspersky.png)](https://opentip.kaspersky.com/haber.chat/)

---

- [Home](https://haber.chat)
- [Terms and conditions](https://haber.chat/terms)
- [Privacy policy](https://haber.chat/privacy)
- [Help center](https://app.haber.chat/help)
- [Blog](https://haber.chat/blog)

Copyright © 2024, Haber.chat

Disclaimer: HaberChat is an independent platform and is not affiliated with, endorsed by, or an official solution for Meta Platforms, Inc., WhatsApp LLC, or any of their related companies.

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "HaberChat Team",
    "url" : "https://haber.chat/blog/author/haberchat-team"
  },
  "dateModified" : "2026-11-11T08:00:01.054Z",
  "datePublished" : "2026-11-11T08:00:00.000Z",
  "headline" : "WhatsApp ChatGPT Bot: How to Build One (2026 Guide)",
  "image" : [ "https://haber.chat/hubfs/blog-featured-images/whatsapp-chatgpt-bot.jpeg" ],
  "mainEntityOfPage" : {
    "@id" : "https://haber.chat/blog/whatsapp-chatgpt-bot",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://haber.chat/hubfs/haber-chat-high-resolution-logo-cropped.png"
    }
  }
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "FAQPage",
  "mainEntity" : [ {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "Yes. Connect the number to a platform with webhooks and an API, such as HaberChat, and run a bot that sends incoming messages to OpenAI and posts the answers back."
    },
    "name" : "Can I connect ChatGPT to my WhatsApp Business number?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "Meta's terms bar AI providers whose AI is the main product, like general-purpose assistants. A business using a bot for its own customer support, where the AI is incidental, isn't the target."
    },
    "name" : "Does Meta allow AI chatbots on WhatsApp?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "A little. Our Node.js bot is ready to run once you add your keys and instructions. If you'd rather not code, HaberChat's AI assistant suggests replies for your agents instead."
    },
    "name" : "Do I need to code to build a WhatsApp ChatGPT bot?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "The customer types \"human\" and the bot assigns the chat to an available agent, then stops replying. Assigning a chat to an agent manually does the same."
    },
    "name" : "How does the bot hand a chat to a person?"
  } ]
}
```