# WhatsApp AI Bot | Chatbot That Uses AI Models APIs To Generate Responses To User Input 🚀

**URL:** <https://onehack.st/t/whatsapp-ai-bot-chatbot-that-uses-ai-models-apis-to-generate-responses-to-user-input/289133>\
**Category:** Tools & Scripts\
**Tags:** tools, freebies, social-media, ai\
**Created:** [August 16, 2024, 8:19pm UTC](https://onehack.st/t/whatsapp-ai-bot-chatbot-that-uses-ai-models-apis-to-generate-responses-to-user-input/289133 "2024-08-16T20:19:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aina](https://onehack.st/user_avatar/onehack.st/aina/32/167469_2.png) [@Aina](https://onehack.st/u/Aina)\
**Post date:** [August 16, 2024, 8:19pm UTC](https://onehack.st/t/whatsapp-ai-bot-chatbot-that-uses-ai-models-apis-to-generate-responses-to-user-input/289133/1 "2024-08-16T20:19:43Z")

</div>

# WhatsApp AI Bot 🚀

The WhatsApp AI Bot is a chatbot that uses AI models APIs to generate responses to user input. The bot supports several AI models, including **`Gemini`** , **`Gemini-Vision`** , **`CHAT-GPT`** , **`DALL-E`** , and **`Stability AI`** , and users can also create their **`own models`** to customize the bot’s behavior.

| ❤ Sponsor | 💎 Bounty | 🚀 Deployment |
| --- | --- | --- |
| [link](https://buymeacoffee.com/zainuldin) | [link](https://wa-ai-seven.vercel.app/feat-req) | [link](https://wa-ai-seven.vercel.app/) |

# Table of Content

- [Demo.](https://github.com/Zain-ul-din/whatsapp-ai-bot#demo)
- [Usage.](https://github.com/Zain-ul-din/whatsapp-ai-bot#usage)
- [Tutorials.](https://github.com/Zain-ul-din/whatsapp-ai-bot#Tutorials)
- [Docs.](https://github.com/Zain-ul-din/WhatsApp-Ai-bot/blob/master/docs/config-docs.md)
- [Disclaimer.](https://github.com/Zain-ul-din/whatsapp-ai-bot#disclaimer)
- [Contributors.](https://github.com/Zain-ul-din/whatsapp-ai-bot#contributors)
- [Sponsors.](https://github.com/Zain-ul-din/whatsapp-ai-bot#Sponsors)
- [About.](https://github.com/Zain-ul-din/whatsapp-ai-bot#about-us)

# Demo

**Gemini**

[![Screenshot (1186)](https://private-user-images.githubusercontent.com/78583049/291598602-b6f256de-c792-4947-bf65-401a60a0b1f4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4Mzk2NjgsIm5iZiI6MTcyMzgzOTM2OCwicGF0aCI6Ii83ODU4MzA0OS8yOTE1OTg2MDItYjZmMjU2ZGUtYzc5Mi00OTQ3LWJmNjUtNDAxYTYwYTBiMWY0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE2VDIwMTYwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI0NDc2YTM0ZWQ0ODQwMTUxNDlkYmNiMDQ2ODcyMGEyYTMyOTVlOTIwMjQ2ZmI3MGU4NGFhYzhlOTdlYmJlYzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.DRfSS_Ty2kfSXLZGR3ly3cl0_UG2Hh6HBBilKr-oKNQ)](https://www.youtube.com/watch?v=dXDxTQQqeq8)

**Stability AI + Chat-GPT**

[![image](https://user-images.githubusercontent.com/78583049/222071673-ef0f2021-a8b4-4263-9304-a77ecd76c0a1.png)](https://user-images.githubusercontent.com/78583049/222071673-ef0f2021-a8b4-4263-9304-a77ecd76c0a1.png)

**Dalle + Custom Model**

[![image](https://user-images.githubusercontent.com/78583049/222074174-55792d13-5137-4c1c-b708-3ad188ca8d8d.png)](https://user-images.githubusercontent.com/78583049/222074174-55792d13-5137-4c1c-b708-3ad188ca8d8d.png)

# Usage

**1. Download Source Code**

git clone [https://github.com/Zain-ul-din/WhatsApp-Ai-bot.git](https://github.com/Zain-ul-din/WhatsApp-Ai-bot.git) cd WhatsApp-Ai-bot

> OR

- [Download Zip File](https://github.com/Zain-ul-din/WhatsApp-Ai-bot/archive/refs/heads/master.zip)

**2. Get API Keys**

- [Gemini API Key](https://makersuite.google.com/app/apikey)
- [OpenAI API Key](https://platform.openai.com/account/api-keys)
- [StabilityAI API Key](https://platform.stability.ai/docs/getting-started/authentication)

**3. Add API Keys**

- create `.env` in the root of the project.
- set following fields in `.env` file

OPENAI\_API\_KEY=YOUR\_OPEN\_AI\_API\_KEY DREAMSTUDIO\_API\_KEY=YOUR\_STABILITY\_AI\_API\_KEY GEMINI\_API\_KEY=YOUR\_GEMINI\_API\_KEY

**4. Run the code**

- run `setup.sh` to start the bot.
- Scan QR code.

**Default Prefix**

- `!gemini` use gemini.
- `!gemini-vision` use `gemini-pro-vision` model for images
- `!chatgpt` use chat-gpt.
- `!dalle` use Dalle.
- `!stable` use Stability AI.
- `!bot` use custom model.

**Note! open `src/whatsapp-ai.config.ts` to edit config.**

[Docs Link](https://github.com/Zain-ul-din/WhatsApp-Ai-bot/blob/master/docs/config-docs.md)

# Tutorials

- **[Setup bot on cloud using Github code-spaces](https://www.youtube.com/watch?v=QahJSi6Ygj4)**
- **[setup bot on a local machine](https://www.youtube.com/watch?v=fyPD3ILFPck)**

### FQA

- [How to create custom model](https://github.com/Zain-ul-din/whatsapp-ai-bot/issues/3)

# Disclaimer

This bot utilizes Puppeteer to operate an actual instance of Whatsapp Web to prevent blocking. However, it is essential to note that these operations come at a cost charged by OpenAI and Stability AI for every request made. Please be aware that WhatsApp does not support bots or unofficial clients on its platform, so using this method is not entirely secure and could lead to getting blocked.

## GitHub:

[https://github.com/Zain-ul-din/whatsapp-ai-bot](https://github.com/Zain-ul-din/whatsapp-ai-bot)
