AI ChatbotsHow-To AEO Optimized

How to Build a WhatsApp AI Chatbot Using OpenAI or Gemini

Step-by-step guide to building an AI chatbot for WhatsApp using OpenAI GPT or Google Gemini. No coding required with the right platform.

WhatsAble Team
··9 min read
How to Build a WhatsApp AI Chatbot Using OpenAI or Gemini

An AI-powered WhatsApp chatbot using OpenAI GPT or Google Gemini can handle 70–80% of inbound customer queries automatically, respond in seconds at any hour, and hand off complex issues to human agents — all without writing a single line of code. WhatsAble's flow builder connects directly to both AI engines, making setup accessible for any business owner.

Quick answer: To build a WhatsApp AI chatbot using OpenAI or Gemini, you need a WhatsAble account, a connected WhatsApp number, and an API key from OpenAI or Google. In WhatsAble's no-code flow builder, create a flow that routes inbound messages to your chosen AI model and returns its response automatically.

What Is an AI-Powered WhatsApp Chatbot?

A traditional chatbot follows rigid rules: "if customer says X, reply with Y." An AI-powered chatbot does something fundamentally different. It understands the meaning of a message rather than matching keywords, can hold multi-turn conversations with context memory, generates human-like responses, and adapts its tone and content to each specific query.

The difference in practice: a rule-based bot fails when a customer phrases a question in an unexpected way. An AI bot understands "what does it cost?", "pricing please", "how much do you charge?", and "I need your rates" as the same question — and answers appropriately.

OpenAI vs Gemini for WhatsApp Chatbots

Both OpenAI GPT and Google Gemini are excellent choices. Here is how they compare for business WhatsApp applications:

AspectOpenAI GPT-4oGoogle Gemini 1.5 Pro
Language qualityExcellentExcellent
Response speedFastFast
Multilingual supportStrongVery strong
Context window128k tokens1M tokens
API pricingPer tokenPer token
Best forGeneral business Q&AMultilingual, document-heavy

For most WhatsApp business chatbots, GPT-4o is the default choice due to its widespread documentation, reliability, and consistent quality. Gemini excels if you need strong multilingual capabilities or very long document context (e.g., answering from a large product catalogue).

What You Need Before You Start

Before building your chatbot:

  1. A WhatsAble accountsign up here
  2. A connected WhatsApp Business number — via QR code or Cloud API
  3. An OpenAI API key from platform.openai.com OR a Google AI Studio API key from aistudio.google.com
  4. A system prompt — a short instruction document that tells the AI how to behave as your business's assistant

The system prompt is the most important element. It tells the AI: who it is, what the business does, what questions it should answer, what tone to use, and when to escalate to a human. A well-written system prompt makes the difference between a generic bot and one that feels like a knowledgeable team member.

Step-by-Step: Building Your Chatbot in WhatsAble's Flow Builder

Step 1: Create a New Flow

In your WhatsAble dashboard, navigate to Flows → New Flow. Give your flow a name (e.g., "AI Customer Support Bot") and select Inbound Trigger as the start event.

Step 2: Configure the Trigger

Set the trigger to activate on any inbound message (or specific keyword triggers if you want the AI to handle only certain conversation types). For a general-purpose bot, "Any message" as the trigger is typical.

Step 3: Add the AI Response Node

Drag an AI Response node from the node panel. This is where you configure which AI model handles the response.

Step 4: Connect OpenAI GPT

  • Select OpenAI as the provider
  • Paste your OpenAI API key
  • Choose the model: gpt-4o (recommended) or gpt-3.5-turbo for lower cost
  • Write your system prompt in the designated field
  • Set max tokens for responses (300–500 is sufficient for most customer service)

Step 5: Add Your System Prompt

A strong system prompt for a WhatsApp business bot looks like this:

You are a customer support assistant for [Business Name], a [brief business description].

Your role is to:
- Answer questions about our products and services
- Provide pricing information
- Help customers with order status inquiries
- Book appointments

Always respond in a friendly, professional tone. Keep responses concise (2–4 sentences). 
If a customer asks to speak to a human, use the escalate action.
Do not make up information — if you are unsure, say so and offer to connect them with the team.

Business hours: Monday–Friday, 9am–6pm
Website: [your website]

Step 6: Add Human Handoff

After the AI node, add a Condition node that checks if the AI confidence score is below a threshold, or if the message contains keywords like "speak to agent", "human", "call me". Connect this to a Transfer to Agent action that moves the conversation to your live inbox.

Step 7: Connect Google Gemini Instead (Optional)

The process is identical using Google Gemini as the provider. Paste your Google AI Studio API key, select the Gemini 1.5 Pro model, and write your system prompt. The same flow logic applies.

Testing and Deploying Your Bot

Before going live:

  1. Use WhatsAble's Test Mode — send test messages within the flow builder to see how the bot responds
  2. Test edge cases — off-topic questions, competitor mentions, angry messages, very short inputs
  3. Review and refine your system prompt based on test results
  4. Enable the flow and monitor the first 24 hours closely
  5. Check the unresolved queries report after the first week to identify gaps

Real Use Case: Handling 80% of Customer Inquiries Automatically

A home services business in Dubai was spending 3–4 hours per day answering WhatsApp inquiries manually — pricing questions, availability checks, service area confirmations, and booking requests.

After building an AI chatbot in WhatsAble with a GPT-4o system prompt trained on their service catalogue:

  • 78% of inbound messages were handled fully automatically within 30 seconds
  • Booking requests were captured by the bot and added to a Google Sheet via webhook
  • Human agents spent their time on complex cases and final booking confirmation only
  • Response time dropped from an average of 47 minutes to under 30 seconds

The bot paid for itself in reduced labour costs within the first week.

For more on chatbot flow design patterns, see our guide on WhatsApp chatbot flow builders.

Build your WhatsApp AI chatbot with WhatsAble →

Frequently Asked Questions

Can I use ChatGPT for WhatsApp?

Yes. By connecting OpenAI's GPT model to WhatsApp through a platform like WhatsAble, your chatbot can understand natural language, answer complex questions, and hold multi-turn conversations — without you writing a single line of code. WhatsAble's flow builder includes a native OpenAI integration.

Is it free to use AI on WhatsApp?

The AI model itself (OpenAI GPT or Google Gemini) charges per API call — typically fractions of a cent per message. WhatsAble's platform fee covers the integration infrastructure. For most businesses handling a few hundred AI conversations per day, the AI API costs are negligible (under $5/month).

How smart are WhatsApp AI chatbots?

Modern AI chatbots using GPT-4o or Gemini 1.5 Pro are extraordinarily capable — they understand context, handle ambiguous questions, recognise intent even with typos, and can be instructed to follow business-specific rules. The main limitation is not intelligence but the instructions and context you provide.

Can the bot hand off to a human agent?

Yes. WhatsAble's flow builder includes a human handoff action. You can configure the bot to transfer conversations to your live agent inbox when specific conditions are met — for example, when a customer asks to speak to a person, uses certain keywords, or has a query the bot cannot confidently answer.

Ready to grow with WhatsApp?

Join thousands of businesses using WhatsAble to automate conversations, run bulk campaigns, and drive revenue on WhatsApp.

Start Free Trial

Related Articles