# How to build an AI girlfriend app in 2026 — architecture, unit economics, pitfalls

> The complete blueprint for an AI companion product: persona architecture, memory, streaming, media moments, storage, and the message-cap economics that decide whether it survives its own best users.

Published 2026-08-23 · eroq.ai — canonical: https://eroq.ai/blog/how-to-build-an-ai-girlfriend-app


AI companion apps are the most demanding product in the character space: users message like it's a relationship (because to them it is), retention hinges on continuity, and your heaviest users are your best customers *and* your biggest cost. This is the blueprint we'd use, with real numbers.

## The architecture, in five decisions

**1. Persona lives in `context`, not in the transcript.** Send the character sheet — identity, voice, boundaries, relationship state — through the [`context` field](/docs/chat) on every call, and keep the `messages` array for actual conversation. Editing a personality mid-relationship becomes a data change, not transcript surgery.

**2. You own memory.** The API is stateless by design. Window the last 20–40 turns, and maintain a rolling summary ("what she knows about him") that you fold into `context`. Companion products die of amnesia; a summary refreshed every 30 turns is the cheapest fix that works.

**3. Stream everything.** Set `stream: true` and relay [SSE chunks](/docs/streaming) to the client. A companion that "types" feels present; a spinner feels like a form. Messaging mode (`mode: "messaging"`) keeps replies texting-length and snappy — the right register for DMs, and it caps your token ceiling.

**4. Media are moments, not wallpaper.** A selfie at a relationship milestone ([10 credits](/docs/images)), a [voice note](/blog/tts-for-ai-characters) when she misses him (3 credits per 100 characters) — scarce, earned, and priced as premium unlocks. Products that autoplay everything spend 10× and retain worse.

**5. Persist media on NSFW-safe storage.** Selfies your users unlock are assets they revisit. Add `store: true` to the generation call and the render lands on the [eroq Store](/storage) CDN with a durable URL — [mainstream buckets are a termination risk](/blog/best-nsfw-friendly-storage-cdn) for exactly this media.

## The unit economics (the part that kills apps)

Flat credits make this math checkable — a completion is 1 credit on RP mini, 3 on RP+, [full table here](/pricing). The number that matters: **an engaged companion user sends 30–60 messages a day.**

| User profile | Messages/day | Model | Credits/month | Cost/month |
| --- | --- | --- | --- | --- |
| Casual | 8 | RP mini | ~240 | ~$2.00 |
| Engaged | 40 | RP mini | ~1,200 | ~$10.00 |
| Engaged, premium | 40 | 30% RP+ | ~1,900 | ~$16.00 |
| Obsessed | 100 | RP mini | ~3,000 | ~$25.00 |

Three conclusions fall out immediately:

- **Uncapped free tiers are suicide.** An energy/message-cap system isn't a growth hack, it's solvency.
- **Price tiers around message volume**, not features. $9.99 casual / $24.99 unlimited maps to the actual cost curve.
- **RP+ is the premium lever**: route paying users' emotional beats to the flagship, keep small talk on mini. The [`model` field](/docs/chat) switches per call.

Don't take the table's word for it — the prices are flat and [public](/pricing), so your own spreadsheet reproduces any cell above in a minute.

## The pitfalls, from production

- **Refusal mid-scene is churn.** It's the moment companions break. eroq's engines render adult scenes between adult characters [by policy](/uncensored-ai-api) — the wall is a written AUP with a deterministic `content_blocked` code, not a filter's mood.
- **Treat HTTP 402 as an upsell, not an error.** Balance-empty is a [product event](/docs/errors): catch it, route to your top-up flow, never show a stack trace.
- **Let users send photos.** Vision-enabled chat ([+2 credits per image](/blog/let-users-send-pictures-vision-roleplay)) is the highest-retention feature per credit in the category — she *reacts to his day*.
- **Log persona breaks.** Every turn where the character slipped, tag it and drop it from future windows. Drift compounds; curation is cheap.

## Ship the walking skeleton first

Day one is [a key](/signup), a system context, a windowed history and a streamed reply — the [character chat tutorial](/blog/build-ai-character-chat-app) has the code. The 50 free credits cover an evening of testing the exact scenes your product will live on. Everything above is iteration.
