MHN AI API

An AI assistant API by MAHENDRO — built for Telegram bots and external apps. Multilingual (Bengali, English...), with date/time awareness and web search.

Base URLs

https://mhngpt.xyz/api/public/ai-chat
https://mhngpt.lovable.app/api/public/ai-chat

Authentication

No authentication required — just POST your message.

Request

POST /api/public/ai-chat
Content-Type: application/json

Body

{
  "message": "আপনার প্রশ্ন...",              // required, 1-8000 chars
  "history": [                              // optional, max 40 messages
    { "role": "user", "content": "..." },
    { "role": "assistant", "content": "..." }
  ]
}

Response (200 OK)

{ "success": true, "reply": "AI এর উত্তর..." }

Errors

400  { "success": false, "error": "Invalid request body" }
502  { "success": false, "error": "<upstream error>" }

Example (curl)

curl -X POST https://mhngpt.xyz/api/public/ai-chat \
  -H "Content-Type: application/json" \
  -d '{"message": "হ্যালো, কেমন আছো?"}'

Limits & notes