AI assistant
esimScan includes an optional AI assistant that powers two features:
- AI eSIM Advisor — a storefront widget where a shopper describes their trip and gets matching plans from your own catalog, each linking straight into checkout.
- Support reply drafting — a Suggest reply button on admin and reseller support tickets that drafts a response for an agent to edit before sending.
Both are off by default. Nothing AI-related runs until you add a key and switch a feature on.
Bring your own AI key — usage is billed by the provider
The AI features cost nothing extra to buy, but every AI request is billed to your AI-provider account. You supply the API key and budget. These costs are not included in the purchase price and are separate from hosting.
Choose a provider
Go to Admin → AI Settings. esimScan supports three providers — pick one active provider:
| Provider | Where to get a key | Notes |
|---|---|---|
| OpenAI | platform.openai.com | Widely available; gpt-4o-mini is a low-cost default |
| Claude (Anthropic) | console.anthropic.com | Defaults to cost-efficient claude-haiku-4-5 (override via ANTHROPIC_MODEL) |
| DeepSeek | platform.deepseek.com | Cost-effective; deepseek-chat |
OpenAI and DeepSeek use the same OpenAI-compatible API under the hood; Claude uses Anthropic's native API. You only configure a key per provider — the model is fixed per provider, so there is nothing else to choose.
Configure
- Admin → AI Settings.
- Paste an API key for the provider(s) you want. Keys are stored encrypted and never shown again (save a key blank to keep the existing one).
- Pick the Active provider.
- Click Test connection under that provider to confirm the key works.
- Turn on Enable AI features (master switch).
- Enable the features you want:
- eSIM Advisor on storefront
- Support reply drafting (admin & client)
- Optionally set Max recommendations (how many plans the Advisor returns).
- Save.
The active provider must have a valid key before AI can be enabled, otherwise the storefront widget and the Suggest-reply button would fail. Make sure the Active provider matches the provider whose key you entered.
Optional .env fallback defaults exist (OPENAI_API_KEY, ANTHROPIC_API_KEY, DEEPSEEK_API_KEY), but a key saved in Admin → AI Settings always takes priority.
How the AI eSIM Advisor works
- A floating AI Advisor button appears at the bottom-right of the storefront. On page load it shows a short greeting bubble inviting the shopper to ask.
- The shopper types their trip (e.g. "Japan for 10 days, Maps and Instagram daily").
- The AI is given only your enabled catalog packages and returns the best matches. It returns package ids, which esimScan resolves back to real rows — so price, currency, and links are authoritative and never invented.
- Each recommendation has a Buy now button that opens checkout with that package selected.
Requirements: AI enabled, the active provider has a valid key, the eSIM Advisor toggle is on, and there is at least one enabled catalog package.
How support reply drafting works
- On a support ticket (in Admin → Support and the reseller Support page), agents see a Suggest reply button above the reply box.
- It drafts a reply grounded in the ticket conversation plus the customer's recent orders (destination, data/validity, status, fulfillment, provider).
- The draft lands in the reply box for the agent to edit and send — it is never sent automatically, and raw activation codes are never exposed in a draft.
Requirements: AI enabled, the active provider has a valid key, and the Support reply drafting toggle is on.
Costs & privacy notes
- Each Advisor recommendation and each drafted reply is one paid API call to your provider. For high traffic, prefer a cheaper model account (e.g.
gpt-4o-mini, Claude Haiku, ordeepseek-chat). - The Advisor only sends your catalog (destinations, data, validity, price). Support drafting sends the ticket text and order summary for that customer. Choose a provider whose data terms suit your business.
- AI keys are stored encrypted with
APP_KEY. KeepAPP_KEYstable, or saved keys become unreadable.
Troubleshooting
| Symptom | Check |
|---|---|
| Advisor button not on the storefront | AI enabled + eSIM Advisor toggle on + active provider has a key; hard-refresh the page |
| Suggest reply button missing | AI enabled + Support reply drafting toggle on + active provider has a key |
| "Test connection" fails | Wrong/expired key, or the Active provider doesn't match the key you entered; check the provider account has billing/credit |
| Advisor returns nothing | No enabled catalog packages, or none match the destination described |