Integrations · Python
WhatsApp Business API
Connect XALEN AI to WhatsApp Business API. Build temple darshan booking bots, astrology consultants, and spiritual guides on WhatsApp.
1. Install
pip install flask twilio xalen
2. Code
# Using Twilio WhatsApp API
#89B4FA;">from flask import Flask, request
#89B4FA;">from twilio.twiml.messaging_response import MessagingResponse
#89B4FA;">from xalen import XALEN
app = Flask(__name__)
client = XALEN(api_key=#A6E3A1;">"xln_test_YOUR_KEY")
@app.route(#A6E3A1;">"/webhook", methods=["POST"])
#89B4FA;">def webhook():
msg = request.values.get(#A6E3A1;">"Body", "")
response = client.chat.completions.create(
model=#A6E3A1;">"vedika-fast",
messages=[{#A6E3A1;">"role": "user", "content": msg}]
)
reply = MessagingResponse()
reply.message(response.choices[0].message.content)
#89B4FA;">return str(reply)
Related Tutorials
Build a React Chatbot Integrations · JavaScript
Next.js API Routes Integrations · JavaScript
Flutter Integration Integrations · Dart
LangChain Integration Integrations · Python
Python Quickstart Getting Started · Python
JavaScript Quickstart Getting Started · JavaScript
200+ AI models. One API. Start building in 5 minutes.
Get API KeyLast updated: 2026-05-21