explaingit

askrella/whatsapp-chatgpt

3,752TypeScriptAudience · vibe coderComplexity · 3/5LicenseSetup · moderate

TLDR

A self-hosted bot that connects WhatsApp to OpenAI's GPT and DALL-E so you can chat with an AI, transcribe voice messages, and generate images directly inside WhatsApp, runs using browser automation since WhatsApp has no official bot API.

Mindmap

mindmap
  root((WhatsApp ChatGPT))
    What It Does
      AI chat in WhatsApp
      Voice transcription
      Image generation
      Browser automation
    Tech Stack
      TypeScript
      Node.js
      Puppeteer
      OpenAI API
    Requirements
      Node.js 18+
      OpenAI API key
      WhatsApp account
    Risks
      Account ban risk
      Unofficial API
      Unmaintained
    Use Cases
      Personal AI assistant
      Voice-to-text replies
      DALL-E image requests
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run a personal AI assistant inside WhatsApp that replies to your text messages using GPT without needing a separate app.

USE CASE 2

Send a voice message and have the bot transcribe it and respond with a GPT-generated reply.

USE CASE 3

Request an AI-generated image by describing it in a WhatsApp message and receive a DALL-E 2 image back.

Tech stack

TypeScriptNode.jsPuppeteerOpenAI API

Getting it running

Difficulty · moderate Time to first run · 30min

Requires a paid OpenAI API account, every message costs money charged to your OpenAI billing. WhatsApp may block your account for using unofficial automation.

Free to use, modify, and distribute for any purpose, including commercial, as long as the MIT license notice is kept.

In plain English

This project connects WhatsApp to OpenAI's AI services so you can chat with an AI assistant directly from your WhatsApp account. Send a text message and the bot replies using GPT. Send a voice message and the bot transcribes it first, then replies. You can also ask it to generate images and it uses DALL-E 2 to do that. The bot works by running a real instance of WhatsApp Web in the background using a browser automation tool called Puppeteer. This is how it connects to WhatsApp without an official API. The README is explicit that WhatsApp does not allow bots or unofficial clients, and there is a risk your account could be blocked, though the approach does work in practice. To run it yourself, you need Node.js 18 or newer, an OpenAI account with an API key, and a WhatsApp account to connect. Each request you make to OpenAI costs money, charged directly to your API account, so this is not a free tool to operate once deployed. The README notes that the project is unmaintained and is looking for someone to take it over. It links to external documentation for installation and configuration steps. The project is licensed under MIT.

Copy-paste prompts

Prompt 1
Walk me through setting up whatsapp-chatgpt on a Linux server: installing Node.js 18, cloning the repo, adding my OpenAI API key, and scanning the WhatsApp QR code to connect.
Prompt 2
How does whatsapp-chatgpt use Puppeteer to connect to WhatsApp without an official API, and what is the account-ban risk I should know about?
Prompt 3
I want to host whatsapp-chatgpt on a cheap VPS so it runs 24/7. What are the minimum server requirements and how do I keep it running after I close the terminal?
Prompt 4
How do I change the OpenAI model used by whatsapp-chatgpt from GPT-3.5 to GPT-4 in the configuration?
Prompt 5
What OpenAI API costs should I expect if I use whatsapp-chatgpt for personal use with around 50 messages per day?
Open on GitHub → Explain another repo

← askrella on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.