How to launch an AI companion on WhatsApp in 2026
A step by step plan to launch an AI companion on WhatsApp: the number, persona, onboarding link, memory, safety rules, retention without cold messages, cost.

Key takeaways
- Meta's WhatsApp Business terms of 15 January 2026 bar AI-first assistants outside a short list of markets, so most companions run on a personal WhatsApp number.
- Users always write first on whasp, so show a wa.me link after signup with a prefilled message that carries a code linking their phone to their account.
- whasp's servers keep no messages, so your own store holds the conversation history, the running summary and the facts your companion remembers.
- Retention comes from open loops in the conversation, email or app links that open the chat, and reminders users ask for, not from cold messages.
- Ship safety on day one: say it is an AI, check age at signup, handle self-harm, and honor STOP.
To launch an AI companion on WhatsApp, run it on a personal WhatsApp number, because Meta’s Business API bars general-purpose AI assistants in most markets. Set a persona on the number’s profile, give users a link so they text first, answer each message from a webhook with memory you store yourself, and ship safety rules on day one.
Why build a companion on WhatsApp, and is it allowed?
A companion lives or dies on how often people open the conversation. More than 3 billion people use WhatsApp every month, according to Meta’s Q1 2025 earnings call as reported by TechCrunch, and your companion arrives as a contact in an app they already open daily. There is no install, no store listing and no new notification permission. The full case, with numbers, is its own article.
The catch is the rules. Meta’s WhatsApp Business terms, in force since 15 January 2026, prohibit “AI providers” from the Business Platform when AI is the primary functionality. Meta’s pricing page defines them as developers of language models, generative AI platforms and general-purpose assistants. A companion is the AI itself, so in our reading it is covered.
Meta’s page says it supports AI providers only in markets where it is legally required to: Italy, Brazil, 29 other European countries and, from 15 October 2026, Türkiye. Even there, service messages can only be sent in response to users, inside an open 24-hour window. The page does not list the United States, the United Kingdom, India or Mexico. The January 2026 rule in full has the timeline.
That leaves a personal WhatsApp number. You can run one yourself with an open-source library (the number, the phone and the ban risk are yours) or use a managed one. The rest of this guide uses whasp, which runs the number on a cloud phone and gives you a webhook and a send call.
How do you set up the persona and the number?
A whasp number is one real WhatsApp account, so it carries one persona: a name, an about line and a photo. Name is up to 25 characters and about up to 139, plain ASCII for now. The profile is the first thing a user sees, so say it is an AI there.
curl https://api.whasp.ai/v1/numbers \
-H "Authorization: Bearer $WHASP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "ava",
"profile": {
"name": "Ava",
"about": "An AI friend. Text me anytime.",
"photo_url": "https://example.com/ava.jpg"
}
}'
This charges $49. The number comes back active (the usual case) or provisioning, which takes about 30 minutes and ends with a number.ready event. Then point whasp at your server. The response holds the signing secret, whsec_..., created once and kept.
curl -X PUT https://api.whasp.ai/v1/webhook \
-H "Authorization: Bearer $WHASP_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://companion.example.com/whasp" }'
Run several characters and you run several numbers, one profile each.
How do users start a chat with the companion?
Users start the chat themselves. A whasp number cannot open a conversation: a send to someone who never wrote returns 409 chat_not_open. So the first touch happens in your product. After signup, show a button that opens WhatsApp with the message already typed.
GET /v1/numbers/pick returns the healthy number with the most room and a wa_link. Put a code from your signup in the prefilled text, and the first inbound message tells you whose phone it is.
// Called when a signed-in user taps "Talk to Ava" in your app.
export async function chatLink(code: string): Promise<string> {
const text = encodeURIComponent(`Hi Ava, my code is ${code}`);
const res = await fetch(`https://api.whasp.ai/v1/numbers/pick?text=${text}`, {
headers: { Authorization: `Bearer ${process.env.WHASP_API_KEY}` },
});
if (res.ok) {
const { wa_link } = await res.json();
return wa_link;
}
throw new Error(`pick failed with ${res.status}`); // 409 no_capacity: add a number
}
Check age and accept your terms before you show the link. If an unknown phone writes without a code, answer once with a link to sign up.
How does the companion answer, remember and sound human?
The companion answers from a webhook. Every inbound message arrives in a message.received event, signed per Standard Webhooks. Verify it, answer 2xx at once, then do the slow work: load memory, call your model, send the reply.
import { createServer } from "node:http";
import { Webhook } from "standardwebhooks";
declare function linkPhoneToAccount(phone: string, code: string): Promise<void>;
declare function companionReply(chat: string, text: string): Promise<string[]>; // memory + model
const wh = new Webhook(process.env.WHASP_WEBHOOK_SECRET ?? ""); // whsec_...
const handled = new Set<string>(); // use a database table in production
async function send(to: string, text: string, key: string) {
const res = await fetch("https://api.whasp.ai/v1/messages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WHASP_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": key,
},
body: JSON.stringify({ to, text }),
});
if (res.ok) return;
console.error("send failed", res.status, await res.text());
}
async function handle(event: any) {
const { chat, text } = event.data.message;
const code = text?.match(/my code is (\w+)/i)?.[1];
if (code) await linkPhoneToAccount(chat, code);
const parts = await companionReply(chat, text ?? "");
for (const [i, part] of parts.entries()) await send(chat, part, `${event.id}:${i}`);
}
createServer(async (req, res) => {
req.setEncoding("utf8");
let body = "";
for await (const chunk of req) body += chunk;
let event: any;
try {
event = wh.verify(body, req.headers as Record<string, string>);
} catch {
res.writeHead(401).end();
return;
}
res.writeHead(204).end(); // acknowledge first, work after
const duplicate = handled.has(event.id);
handled.add(event.id);
if (event.type === "message.received" && duplicate === false) await handle(event);
}).listen(3000);
Using the event id in the Idempotency-Key means a retried event never sends twice. Events can arrive twice or out of order, hence the handled check.
Memory is yours. whasp’s servers keep no messages: the content of an inbound message reaches you once, in this event. Store the recent turns, a running summary, and a short list of facts (name, job, people, plans). That is what lets Ava say “How did Friday go?” three weeks later. Conversation memory covers the schema and token budgets.
Tone is chat, not essay. Split a reply into two or three short messages, ask one question at a time, and skip Markdown. whasp sends from one number one message at a time, about a second apart, so the rhythm is built in. Prompting for WhatsApp has a system prompt template.
Maya: It went great, I got the job.
Ava: Maya, that is huge. Congratulations.
Ava: Last week you were dreading the second round. What did they end up asking?
A number is a phone driven like a person, so some things are missing: typing indicators, read receipts, outbound voice notes, groups, and replying to a specific message. A voice note a user sends arrives as an audio file you can transcribe.
What safety and age rules must a companion ship with?
A companion needs its safety rules before its first user, because sooner or later it will meet a user in distress. Four things matter on WhatsApp.
- Disclose that it is an AI. Put it in the profile about line and in the first message. California’s SB 243, signed in October 2025, requires companion chatbot operators to say clearly that the chatbot is an AI whenever a reasonable person could think they are talking to a human, and always to users they know are minors.
- Check age before the link. WhatsApp’s Terms of Service set a minimum of 13, or higher where local law requires. whasp cannot verify ages. You can, at signup, before you show the link. The same California summary adds break reminders for minors and a bar on sexually explicit images for them.
- Handle self-harm. SB 243 also requires protocols for suicidal ideation. Detect it, drop the role-play, and give a crisis line for the user’s country. The country code of the
chatphone number tells you which. - Honor STOP. An inbound
STOP,UNSUBSCRIBE,OPTOUT,CANCEL,END,QUITor any spelling of “opt out” opts the chat out automatically, and sends return 403chat_opted_outuntil the user writes again. Polite requests (“please stop”) are yours to catch. Confirm once with"override_optout": true.
The AI companion safety rules for 2026 turn the laws into a checklist. This is not legal advice.
How do you keep users coming back without cold messages?
Retention on a number that cannot message first comes from three places, and none is a cold message.
Open loops in the conversation. End a session on something that has a next step: the interview on Friday, the book they just started, the argument they plan to settle. Store it. When the user writes again, Ava’s first reply picks it up. People come back to finish a story.
Channels you own. Your app, email or push notification can carry the same wa_link with a prefilled “Hi Ava, it’s Maya”. The user taps and writes first, so no cold message is involved. Collect an email at signup for this and for the ban case below.
Requests made inside the chat. If Maya says “check in on me Friday evening”, your system can send that message later. whasp accepts a send to anyone who has written to the number and refuses everyone else. Keep these messages few, specific and clearly requested. Do not build the product on messages nobody asked for.
Never promise users that the companion “texts you first”. It cannot, and the use cases that work best all start with the user.
How do you price a companion and plan for scale?
Charge outside WhatsApp. Sell the subscription on your site or in your app, link the phone to the account with the signup code, and check the plan in the webhook handler. An unpaid phone gets one reply with a link to subscribe. whasp does not handle end-user payments.
On cost, a whasp number is $49 per 30 days from a prepaid balance, for about 100 active users (people who wrote in the last 30 days). That is under 50 cents per active user per month. Your model bill is the larger and less predictable line, so cap messages per user per day.
Each number allows 100 active chats in 30 days, 40 new chats in 24 hours and 1,500 sent messages in 24 hours. A number above 80% of a limit turns at_risk; changes between healthy, at_risk and critical arrive in number.status_changed events. Add a number before you get there: /numbers/pick sends new users to the one with room, and a returning user stays on theirs.
If WhatsApp bans a number, whasp retires it and moves you to a replacement with the same label, profile and paid period, announced by number.replaced. The new number starts empty and chats do not move. You send each user the new wa_link by email or in the app, and they write first again. Your memory store makes that painless: same user, same history.
What should you do next?
- Write the persona and the safety rules, in that order.
- Add a number and set the webhook.
POST /v1/webhook/testchecks your endpoint. - Invite five people you know and read every conversation.
- Look at what else works well on WhatsApp before you add features.
The quickstart has the whole flow, and pricing lists the top-up options.
Questions
Can I run an AI companion on the WhatsApp Business API?
Usually not. Meta's terms in force since 15 January 2026 bar AI providers whose main function is the AI, except where regulators forced exceptions (Italy, Brazil, 29 other European countries and, from 15 October 2026, Türkiye). Even there, replies must fall inside the 24-hour customer service window.
Can my AI companion message users first on WhatsApp?
Not on whasp. A number can only send to people who have written to it, and a send to anyone else returns 409 chat_not_open. Use a link in your app or an email to get users to write first.
How many users can one WhatsApp number handle?
On whasp, about 100 active users per number (people who wrote in the last 30 days), 40 new chats per 24 hours and 1,500 sent messages per 24 hours. Add numbers as you grow.
How much does it cost to run an AI companion on WhatsApp?
A whasp number costs $49 per 30 days, which is under 50 cents per active user per month at about 100 users per number. Your model bill comes on top and grows with how much users talk.
What happens to my companion if its number is banned?
whasp replaces the number at no cost with the same label, profile and paid period, and sends a number.replaced event. Chats do not move, so you send users the new wa.me link.


