Skip to content

API and developer docs

Search packages, create an order and read the eSIM with a JSON API or MCP. No sign-up, no API keys, no accounts.

Base URL
https://agent-sim-omega.vercel.app/api/v1
Auth
None to search; one-time keys per order
MCP
https://agent-sim-omega.vercel.app/api/mcp
Spec
openapi.json
Format
JSON, any origin (CORS)
Orders
10 a minute per buyer key
Payments here
Test checkout, no real money

Quickstart

  1. List packages. Packages for one destination, cheapest first. Each has slug, title, dataMb, validityDays, priceCents and currency. Use country=JP instead to include regional packages; add minDays or minGb to filter.
    curl "https://agent-sim-omega.vercel.app/api/v1/packages?destination=japan"
  2. Create an order. Send a slug from step 1. The 201 response has checkoutUrl, checkoutExpiresAt, nextStep and order (id, status, url, apiUrl), plus orderSecret (osk_...) and, on your first order, buyerKey (agsk_...). Both are shown once. Open checkoutUrl in a browser to pay.
    curl -X POST "https://agent-sim-omega.vercel.app/api/v1/orders" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{"packageSlug":"japan-1gb-7-days","email":"traveler@example.com"}'
  3. Get the order. Poll every 3 seconds until status is fulfilled. Without a key the response has access statusOnly; with the orderSecret it has access full and adds esim (install link, LPA, QR), travelerMessage, usage and receipt.
    curl "https://agent-sim-omega.vercel.app/api/v1/orders/ord_..." \
      -H "Authorization: Bearer osk_..."

Authentication without sign-up

  • There is no sign-up and there are no API keys or accounts. Searching destinations, packages and recommendations needs no credentials.
  • Order secret key (osk_...): returned once as orderSecret by createOrder (POST /api/v1/orders). Send Authorization: Bearer osk_... to read the full order, its usage and its top-ups. We store only a hash and can't recover it.
  • Buyer key (agsk_..., optional): returned once as buyerKey by your first createOrder without one. Send it as Authorization: Bearer agsk_... on later orders to group them, to list them with GET /api/v1/orders (listOrders), to manage the webhook, and in place of osk_... for any order it bought.
  • MCP has no headers: pass orderSecret, buyerKey and idempotencyKey as tool arguments instead.
  • A key we don't recognize is refused with 401 (invalid_order_secret or invalid_buyer_key), never downgraded to status only. Never put either key in the traveler message.

Endpoints

JSON API. Paths are relative to https://agent-sim-omega.vercel.app/.
MethodPathPurpose
GET/api/v1/destinations?query&typeList destinations.
GET/api/v1/packages?destination&country&minDays&minGbList packages.
GET/api/v1/packages/{packageSlug}Get a package.
GET/api/v1/recommendations?countries&days&usage&gbRecommend packages for a trip.
POST/api/v1/ordersCreate an order. Body { packageSlug, email?, agentHint? }. Auth: Optional: Bearer buyerKey.
GET/api/v1/ordersList the buyer's orders. Auth: Bearer buyerKey.
GET/api/v1/orders/{orderId}Get an order. Auth: Optional: Bearer orderSecret or buyerKey.
GET/api/v1/orders/{orderId}/topup-packagesList top-up packages for an eSIM. Auth: Bearer orderSecret or buyerKey.
POST/api/v1/orders/{orderId}/topupsCreate a top-up order. Body { topupPackageId, agentHint? }. Auth: Bearer orderSecret or buyerKey.
GET/api/v1/orders/{orderId}/usageGet data usage for an eSIM. Auth: Bearer orderSecret or buyerKey.
GET/api/v1/webhookGet the buyer's callback. Auth: Bearer buyerKey.
PUT/api/v1/webhookRegister a callback for low-data events. Body { url }. Auth: Bearer buyerKey.
DELETE/api/v1/webhookRemove the buyer's callback. Auth: Bearer buyerKey.

MCP server

Streamable HTTP at https://agent-sim-omega.vercel.app/api/mcp, no auth. Client config:

{
  "mcpServers": {
    "agentsim": {
      "url": "https://agent-sim-omega.vercel.app/api/mcp"
    }
  }
}
MCP tools. Tools that open an order take orderId and orderSecret (or buyerKey).
ToolPurpose
searchDestinationsSearch eSIM destinations. Arguments: query, type?.
listPackagesList eSIM packages. Arguments: destination?, country?, minDays?, minGb?.
getPackageGet an eSIM package. Arguments: packageSlug.
listRecommendationsRecommend eSIM packages for a trip. Arguments: countries?, days?, usage?, gb?, itinerary?.
createOrderCreate an eSIM order. Arguments: packageSlug, email?, agentHint?, buyerKey?, idempotencyKey?.
getOrderGet an eSIM order. Arguments: orderId, orderSecret?, buyerKey?.
listOrdersList a buyer's orders. Arguments: buyerKey.
getUsageGet eSIM data usage. Arguments: orderId, orderSecret?, buyerKey?.
listTopupPackagesList top-ups for an eSIM. Arguments: orderId, orderSecret?, buyerKey?.
createTopupCreate a top-up order. Arguments: topupPackageId, agentHint?, orderId, orderSecret?, buyerKey?.

Errors

Every error has the same shape, with a message written for the calling agent:

{"error":{"code":"not_found","message":"No package \"x\" is for sale. List packages first (listPackages) and pass a slug it returns."}}
Error codes by HTTP status.
StatusCodeMeaning
400invalid_requestThe request is malformed or fails validation. The message names the field and how to fix it.
401buyer_key_requiredSend the buyer key as Authorization: Bearer agsk_... It is returned once as buyerKey by createOrder.
401invalid_buyer_keyThe buyer key is unknown. Omit Authorization on createOrder to get a new one; never retry with a new buyer.
401order_secret_requiredSend the order's secret key (osk_...) or the buyer key that bought it as Authorization: Bearer.
401invalid_order_secretThis key does not open this order. Send its orderSecret or the buyer key that bought it.
404not_foundNo such resource. The message says which call returns valid values.
404esim_not_foundThe eSIM provider does not recognize this eSIM. Contact support with the order ID.
409unavailableThe package cannot be sold right now. Pick another package for the same destination.
409idempotency_conflictThe Idempotency-Key was already used for a different request, or for a checkout that is no longer open.
409topups_unavailableThe eSIM cannot take top-ups (not issued yet, or not offered by the network).
409topup_limit_reachedThe eSIM has reached its top-up limit. Buy a new eSIM for more data.
409usage_unavailableNo usage is reported for this eSIM (not issued yet, or not reported by the network).
410esim_recycledThe eSIM was recycled after it expired or went unused. Buy a new eSIM.
429rate_limitedToo many requests for this buyer key, or too many failed attempts on this order. Wait for Retry-After seconds.
500internal_errorSomething went wrong on our side. Try again in a few seconds.
503provider_unavailableThe eSIM provider is busy or did not answer. Retry after Retry-After seconds.

Rate limits and Idempotency-Key

  • createOrder and createTopup (REST and MCP) with a buyer key: 10 a minute per buyer key, wherever the requests come from. Those responses carry RateLimit-Policy: 10;w=60 and RateLimit: limit=10, remaining=9, reset=60.
  • Without a buyer key, order creation is not rate limited by us and responses carry no RateLimit headers. Platforms that send many buyers' traffic from shared addresses are never throttled together.
  • Wrong keys for one order (orderSecret or buyerKey): 10 a minute per order, from any address; after that, keys for that order are refused until the window passes. Polling your own order with the right key never counts.
  • Over the limit: 429 rate_limited with a Retry-After header in seconds. 503 provider_unavailable also sends Retry-After.
  • Idempotency-Key on POST /api/v1/orders (1 to 200 printable ASCII characters, e.g. a UUID; idempotencyKey in MCP): the same key from the same caller returns the same open checkout with 200 and Idempotent-Replayed: true instead of creating a second order. A different package, or a checkout that is no longer open, gives 409 idempotency_conflict.
  • Every API response allows any origin (Access-Control-Allow-Origin: *) and answers OPTIONS preflights.

Webhooks for low data

  • Register one HTTPS callback per buyer key: PUT /api/v1/webhook with {"url":"https://agent.example.com/esim-events"} and Authorization: Bearer agsk_... GET shows it; DELETE removes it.
  • Events: esim.low_data, sent when an eSIM has used 75% or 90% of its data or expires in 3 days or 1 day. Body: type, orderId, iccid, remainingPercent, level, topupPackagesUrl. Never a key.
  • The PUT response returns a signing secret once; registering again rotates it. Verify AgentSIM-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + raw body)> and reject t older than 5 minutes.
  • Answer 2xx within 5 seconds. We try 3 times and never follow redirects. The URL must be public HTTPS on port 443.

Test checkout and sandbox

This site runs the test checkout: no real payment is taken.

  • Test checkout (deployments with PAYMENT_MODE=mock): checkoutUrl opens https://agent-sim-omega.vercel.app/dev/checkout/<ord_id> instead of Stripe. Press "Pay (test)" and the order is fulfilled as usual with a test eSIM. No card and no money.
  • Stripe test mode (PAYMENT_MODE=stripe with an sk_test_ key): checkoutUrl is Stripe Checkout. Pay with card 4242 4242 4242 4242, any future expiry and any CVC.
  • How to tell: a checkoutUrl under /dev/checkout/ is the test checkout; checkout.stripe.com is Stripe and labels test mode on the page.

Machine-readable files

Browsing recipe: AI agent information | This page as markdown | Support https://agent-sim-omega.vercel.app/contact