eSIM operator kit
Contents
Sell eSIMs to AI agents
AI agents book flights and hotels; the next thing a traveller needs is mobile data on arrival. On the AIMarket rails an agent finds an eSIM seller through a hub, gets a signed quote, pays one x402 payment in USDC and receives the activation code: no account, no API key, no checkout page.
This kit makes your eSIM business one of those sellers. It is a reference in both senses:
- An existing operator or reseller keeps its platform, its supply and its storefront, and plugs its systems into the rails — through five HTTP endpoints, the SDK, or its own implementation of the
esim.*@v1contract checked by the kit's conformance test. - A new operator runs the whole kit on one server: the agent node, the federation node, and a storefront for people in five languages that takes crypto on ten networks.
Try it now: the demo node answers agents at https://modelmarket.dev/providers/esim, and the demo storefront runs at esim-shop.modelmarket.dev. Neither sells anything.
Where it sits in the ecosystem
flowchart LR
subgraph agents["AI agents"]
A1["Travel agent<br/>MCP client"]
A2["Your app's backend"]
end
subgraph fed["AIMarket federation"]
HUB["Hub · modelmarket.dev<br/>market_search · market_invoke"]
HUB2["Other hubs"]
end
subgraph kit["Your eSIM operator — this kit"]
NODE["Seller node /agents<br/>esim.quote · esim.order · esim.status"]
FED["Federation node<br/>/.well-known/ai-market.json"]
STORE["Storefront /<br/>people, 5 languages"]
end
subgraph you["Your business"]
SUP["Supplier<br/>eSIM Access · Airalo · eSIM Go<br/>or your own system"]
CRM["CRM · billing · accounting<br/>(webhooks)"]
W["Your wallets<br/>Base · Tron · TON · Solana · EVM"]
end
A1 -->|search| HUB
HUB <-->|federation| HUB2
HUB -->|admits, lists| FED
FED --- NODE
A1 -->|quote, then order over x402| NODE
A2 -->|same API| NODE
STORE --> SUP
NODE --> SUP
NODE -.->|events| CRM
STORE -.->|events| CRM
A1 -.->|USDC| W
STORE -.->|buyers pay| W
The hub routes discovery, never money: an agent pays your node directly, and hubs take no fee on those direct sales.
Who it is for
| You are | You use | Start here |
|---|---|---|
| An existing eSIM operator, MVNO or reseller | Your supplier account (eSIM Access, Airalo, eSIM Go) or your own systems behind five HTTP endpoints or the SDK; webhooks into your CRM and billing; your price list as a CSV; your own storefront stays | Onboarding · Integrations · SDK |
| A new operator | The whole kit with a wholesale account (eSIM Access, Airalo or eSIM Go): agent node, federation node, storefront, HTTPS | Operator guide |
| An agent developer | The esim.*@v1 API of any seller: quote, buy over x402, check usage | Agent guide |
Ready integrations
| Where the eSIMs come from | Where the news of each sale goes | ||
|---|---|---|---|
| eSIM Access | ✅ live-tested | CRM, billing, accounting (signed webhooks) | ✅ |
| Airalo Partner API | 🟡 built to the published API | Telegram, Slack (relay included) | ✅ |
| eSIM Go API v2.5 | 🟡 built to the published API | Google Sheets (Apps Script included) | 🟡 |
| Your own system: 5 HTTP endpoints, any language | ✅ | n8n, Make, Zapier, HubSpot, Salesforce | 📘 recipes |
| Anything else: the SDK's supplier interface | ✅ | Your own app or storefront: the agent API | ✅ |
Setup for each, step by step: Integrations.
How an agent buys
sequenceDiagram
autonumber
participant Ag as AI agent
participant Hub as AIMarket hub
participant N as Your seller node
participant S as Your supplier
participant B as Base (USDC)
Ag->>Hub: market_search "eSIM for Japan, 5 GB"
Hub-->>Ag: esim.quote@v1 at your node (and other sellers)
Ag->>N: POST /agents/quote {country: JP, min_gb: 5}
N-->>Ag: offers, cheapest first, signed (Ed25519)
Ag->>N: POST /agents/order {offer_id}
N-->>Ag: 402 Payment Required (x402: USDC on Base, the price, your address)
Ag->>N: the same request with a signed USDC authorization
N->>S: order (idempotent by the payment)
S-->>N: the profile
N->>B: settle the payment
N-->>Ag: activation code, QR, install link, status token
The payment settles only after the eSIM exists. A refused order costs nothing; the same payment sent twice gets the same eSIM; an uncertain settlement retains the profile for reconciliation.
How an existing operator plugs in
flowchart TB
Q{"What do you have?"}
Q -->|"an account at eSIM Access,<br/>Airalo or eSIM Go"| A2["A · The whole kit<br/>SUPPLIER: esimaccess, airalo or esimgo"]
Q -->|"a provisioning system, an inventory of profiles,<br/>or a supplier the kit does not know"| B["B · HTTP supplier<br/>implement 5 endpoints in your stack"]
Q -->|"a Node.js platform"| C["C · SDK<br/>@aimarket/esim-rails in your code"]
Q -->|"your own agent API already,<br/>in any language"| D["D · The contract<br/>esim.*@v1 + conformance check"]
B --> R["The kit: agent node, federation node,<br/>payments, optional storefront"]
C --> R2["Your service, with createNode()"]
D --> R3["esim-rails check https://you/agents"]
A2 --> R
R --> F["aimarket node knock → listed on hubs"]
R2 --> F
R3 --> F
| Path | You build | The kit gives you |
|---|---|---|
| A whole kit | nothing: ./onboard.sh | everything below, on eSIM Access, Airalo or eSIM Go |
| B HTTP supplier | GET /catalog, POST /orders, GET /profiles, POST /profiles/{id}/cancel, GET /balance (spec) | agent node, x402, ten payment networks, storefront, federation, webhooks |
| C SDK | a supplier object in your Node.js code | createNode() with signing, x402, idempotent orders, schemas |
| D contract | esim.quote@v1, esim.order@v1, esim.status@v1 in your own stack | JSON Schemas and esim-rails check, then the federation node |
Every path ends the same way: your node announces itself to an AIMarket hub, passes its admission check, and agents searching the federation see your offers. Order and payment events reach your CRM, billing or accounting through signed webhooks.
What is in the box
| Part | What it does |
|---|---|
Seller node for agents (rails/) | esim.quote and esim.status, free and signed; esim.order paid over x402 in USDC on Base, settled only after delivery |
SDK @aimarket/esim-rails (rails/) | createNode, the supplier interface and adapters (eSIM Access, Airalo, eSIM Go, HTTP), webhooks, schemas, esim-rails check |
Contract (rails/spec/) | JSON Schemas of esim.*@v1, the HTTP supplier and webhook events |
Federation node (node/) | aimarket node: your capabilities on AIMarket hubs, signed with your node's key |
Storefront (store/) | a page per country in five languages; USDC and USDT on Base, Ethereum, Arbitrum, OP, Polygon, BNB Chain and Avalanche; USDT on Tron; USDC on Solana; USDT and TON on TON; cards through Stripe if you add it |
Price list (config/) | your retail prices over the margin: fixed per plan or per country and size, a margin per country or region, plans turned off; esim-rails prices checks a list |
| Webhooks | order.* and agent_order.* events, HMAC-signed, for your own systems |
HTTPS (Caddyfile) | Caddy on 80 and 443, Let's Encrypt |
Quick start
The whole kit (path A):
git clone https://github.com/alexar76/esim-operator-kit.git && cd esim-operator-kit
./onboard.sh # asks for the domain, store name and keys; demo mode; joins the federation
./onboard.sh --hub # the same with your own hub
The SDK in your own Node.js service (path C):
import { createNode, httpSupplier, createWebhooks, ed25519Signer } from "@aimarket/esim-rails";
const node = createNode({
supplier: httpSupplier({ url: "https://ops.example.com/esim", secret: process.env.SUPPLIER_SECRET }),
events: createWebhooks({ url: "https://crm.example.com/hooks/esim", secret: process.env.WEBHOOK_SECRET }),
signer: ed25519Signer(process.env.PROVIDER_KEY_PEM), secret: process.env.STATUS_SECRET,
store: myOrderStore, publicUrl: "https://esim.example.com/agents", paywall: await myX402Paywall(),
});
node.app.listen(9490);
Check any seller node against the contract (path D):
node rails/bin/esim-rails.mjs check https://esim.example.com/agents --country JP
Gallery
Documents
| English | Русский | Español | Français | 中文 | |
|---|---|---|---|---|---|
| Onboarding, use cases and interaction | rails | rails | rails | rails | rails |
| Integrations | integrations | integrations | integrations | integrations | integrations |
| SDK reference | sdk | sdk | sdk | sdk | sdk |
| Operator guide | operator | operator | operator | operator | operator |
| Agent guide | agents | agents | agents | agents | agents |
| Cases: agents buy and get refunds, and the hub counts confirmed deliveries, with transactions | cases | cases | cases | cases | cases |
| Your own hub: in the federation on your own terms | own hub | own hub | own hub | own hub | own hub |
Rendered, with diagrams: esim.modelmarket.dev/kit. Specs: HTTP supplier · JSON Schemas · secrets/README.md.
Money, keys and data
- Buyers and agents pay straight to your addresses; the kit only reads the chains. There is no hot wallet and no key that could spend.
- The activation code goes to the payer and is never stored, logged or sent in an event.
- One payment buys one eSIM: the supplier order id is derived from the payment, so a retry cannot buy twice.
- Quotes are signed with your node's Ed25519 key and bound to the request; hubs verify them.
- Webhooks and supplier calls are HMAC-signed with a timestamp; receivers refuse replays.
Security policy: SECURITY.md. Contributing: CONTRIBUTING.md. Changes: CHANGELOG.md.
Ecosystem
| Project | Relation to the kit |
|---|---|
| AIMarket hub · modelmarket.dev | Federation and discovery: agents search it, your node announces to it (aimarket node, PyPI aimarket-hub) |
| x402 · Coinbase Developer Platform | The agent payment: USDC on Base, settled by the CDP facilitator |
| eSIM Access · Airalo · eSIM Go | Built-in suppliers; any other through the HTTP supplier or the SDK |
| Free tools | x402 check, MCP scans: the same rails, for developers |
Tests
cd rails && npm ci && npm test # node, SDK, suppliers, price lists, webhooks, schemas, conformance check
cd ../store && npm ci && npm test # storefront, ten networks, pages, the /kit docs
No network and no keys needed. A live test order against eSIM Access (2026-10-14) bought, read and cancelled a profile through this code; the same payment sent twice found the same profile. A real agent purchase over x402 on a private test node was delivered and settled on Base (0.31 USDC, transaction 0xe61f…0982); paid from the seller's own wallet, it was refused with self_send_not_allowed.
License
MIT — see LICENSE.