otpwatch handler_api.php recipes
Get API key

An OTP number panel on top of handler_api

A panel, or "OTP selling website", resells access to the platform's numbers. Your customers top up with you, pick a service and a country, and your server orders the number with one API key. This page is about the money and the limits of that setup: where the markup sits, what the price list looks like after rounding, and what the panel should refuse.

Get an API key Opens sign-up on SimAggregator, the marketplace this API belongs to. Key in the dashboard, balance in USD.

What is being resold

"OTP selling" means two different things online. Here it means one: you resell access to numbers on the platform, at your price, to people who need an SMS code for their own account. It does not mean putting your own SIM cards to work receiving codes for other people's accounts. A panel built from this page never touches a SIM card.

The setup has three layers, and only the middle one is yours to write:

Storefront

The page your customers see: services, countries, your prices, their balance, their orders and codes. It talks only to your backend.

Your backend

Holds the API key, the price list with your markup, each customer's balance and every order. It is the only thing that calls handler_api.php.

handler_api.php

Holds your platform balance and issues numbers and codes. The key goes in the query string of every GET request, so a single call made from the browser would show it to anyone who opens the developer tools.

The order loop itself (order, poll, close, refund) is the same as in a bot. The Telegram number bot page has it as runnable code, with a table of every reply and what it does to the customer's money.

Where the markup goes

The platform charges you its cost; whatever you add on top lives in your backend. Five places decide what you actually keep:

WhereWhat it doesWhat to watch
The quoteyour price = getPrices cost plus markup, saved with the orderthe customer pays the quoted price, not whatever the price is a minute later
maxPrice on the orderset to the cost you quoted; the platform will not place the order above itWRONG_MAX_PRICE:<lowest>: quote again, never re-order silently at a higher cost
Markup per servicea separate percentage for each service you sellone flat rate makes cheap services look expensive or expensive ones thin
A floor per numbera minimum margin in dollars on top of the percentagewithout it, a percentage of a cent rounds to almost nothing
Roundingwhole cents, or whole units of your customers' currencyrounding up changes the real markup most on the cheapest numbers

The platform's prices and your balance there are in US dollars: getNumberV2 reports currency: 840, the ISO 4217 code for USD. If your customers pay in another currency, convert at display time with your own rate and keep the ledger in dollars, so a refund returns exactly what was held.

What the markup looks like after rounding

The same 20% on the cheapest number of each service, rounded up to a whole cent. The percentage is an example input, not advice; the cost column is the "from" price on the snapshot date.

ServiceCheapest countryCost from+20%, cents upReal markup
WhatsAppIndonesia$0.1875$0.2323%
TelegramIndonesia$0.1875$0.2323%
GoogleIndonesia$0.025$0.0320%
FacebookIndonesia$0.0125$0.0260%
TikTokIndonesia$0.0125$0.0260%
DiscordIndonesia$0.0125$0.0260%
OpenAIArgentina$0.025$0.0320%
ClaudeUnited Kingdom$0.0213$0.0341%

“From” price per one-off activation, USD, read from public SimAggregator pages on (UTC). Prices move; getPrices gives the live figure.

The cheaper the number, the further the real markup drifts from the one you set. A panel that shows prices in cents is in practice charging a fixed fee on its cheapest numbers. Decide that on purpose: set the floor in the code below, and look at this column for the services you sell.

Price list code

One call per service builds the storefront: getPrices with service and no country lists every country that has it. Drop the countries with count 0, keep the cost next to your price for maxPrice, and cache the list for a short time: every call counts toward the key's 600 requests per minute, the same budget your order polling uses.

.env.example
# handler_api reference: https://otpwatch.com/otp-number-panel
# Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
SMS_API_BASE_URL=https://sim-aggregator.org/stubs/handler_api.php
# Key from the SimAggregator dashboard: https://otpwatch.com/key
SMS_API_KEY=
pricing.py
# handler_api reference: https://otpwatch.com/otp-number-panel
# Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
import json
import os
import urllib.parse
import urllib.request
from decimal import ROUND_UP, Decimal

SMS_URL = os.getenv("SMS_API_BASE_URL", "https://sim-aggregator.org/stubs/handler_api.php")
SMS_KEY = os.environ["SMS_API_KEY"]
MARKUP_PCT = Decimal(os.environ["PANEL_MARKUP_PCT"])  # your percentage
MIN_MARGIN = Decimal(os.environ["PANEL_MIN_MARGIN"])  # your floor per number, USD
SELL = set(os.environ["PANEL_SERVICES"].split(","))  # the only services the panel sells


def sms(action: str, **params) -> str:
    query = urllib.parse.urlencode({"action": action, "api_key": SMS_KEY, **params})
    with urllib.request.urlopen(f"{SMS_URL}?{query}", timeout=30) as r:
        return r.read().decode().strip()


def sell_price(cost: Decimal) -> Decimal:
    price = max(cost * (100 + MARKUP_PCT) / 100, cost + MIN_MARGIN)
    return price.quantize(Decimal("0.01"), rounding=ROUND_UP)


def storefront(service: str) -> list[dict]:
    """Countries in stock for one service, cheapest first, with the cost kept for maxPrice."""
    if service not in SELL:
        raise ValueError(f"{service} is not on this panel")
    reply = sms("getPrices", service=service)
    if not reply.startswith("{"):
        raise RuntimeError(reply)  # BAD_SERVICE, BAD_KEY ...
    rows = []
    for country, services in json.loads(reply).items():
        cell = services.get(service)
        if cell and cell.get("count"):
            cost = Decimal(str(cell["cost"]))
            rows.append({"country": country, "cost": cost, "price": sell_price(cost)})
    return sorted(rows, key=lambda r: r["price"])


if __name__ == "__main__":
    for row in storefront("tg"):
        print(row["country"], row["cost"], row["price"])
pricing.mjs
// handler_api reference: https://otpwatch.com/otp-number-panel
// Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
const SMS_URL = process.env.SMS_API_BASE_URL ?? "https://sim-aggregator.org/stubs/handler_api.php";
const SMS_KEY = process.env.SMS_API_KEY;
const MARKUP_PCT = Number(process.env.PANEL_MARKUP_PCT); // your percentage, whole number
const MIN_MARGIN = Math.round(Number(process.env.PANEL_MIN_MARGIN) * 10000); // your floor per number, USD
const SELL = new Set(process.env.PANEL_SERVICES.split(",")); // the only services the panel sells

async function sms(action, params = {}) {
  const res = await fetch(`${SMS_URL}?${new URLSearchParams({ action, api_key: SMS_KEY, ...params })}`);
  return (await res.text()).trim();
}

// Prices in 1/100 of a cent so 0.1875 stays exact; the result is whole cents, rounded up.
export function sellCents(cost) {
  const units = Math.round(cost * 10000);
  const withPct = Math.ceil((units * (100 + MARKUP_PCT)) / 100);
  return Math.ceil(Math.max(withPct, units + MIN_MARGIN) / 100);
}

// Countries in stock for one service, cheapest first, with the cost kept for maxPrice.
export async function storefront(service) {
  if (!SELL.has(service)) throw new Error(`${service} is not on this panel`);
  const reply = await sms("getPrices", { service });
  if (!reply.startsWith("{")) throw new Error(reply); // BAD_SERVICE, BAD_KEY ...
  return Object.entries(JSON.parse(reply))
    .filter(([, s]) => s[service]?.count)
    .map(([country, s]) => ({ country, cost: String(s[service].cost), cents: sellCents(s[service].cost) }))
    .sort((a, b) => a.cents - b.cents);
}

Both were run against a local mock that answers getPrices in the documented shape: a $0.0125 cost with a 20% markup and a $0.02 floor comes out at $0.04, a $1.38 cost at $1.66, and a country with count 0 is left out.

Catalog, limits and the platform balance

  • Names and ids. getServicesList with country lists the services sold in that country, as code and name. getCountries maps numeric ids to two-letter ISO codes in its eng field. Country ids and service codes have the lookups.
  • One key, all customers. 600 requests per minute per key, and status polling once every 2 to 5 seconds per open activation. CHANNEL_LIMIT means the account has reached its limit of simultaneous activations: queue new orders instead of failing them.
  • The balance behind the panel. Watch getBalance and stop taking orders before the platform answers NO_BALANCE. Funding with USDT TRC-20 covers the top-up.
  • After a crash. getCurrentActivationsList returns the key's open orders. Settle them against your own table before the storefront opens again.
  • Rentals. duration d1, d3 or d7 on the order rents the number for 1, 3 or 7 days instead of one code: renting a number over the API.

What the panel must not sell

These go in the panel's terms and in its code:

  • No banks, payment apps, wallets or government services. Sell from an allowlist (PANEL_SERVICES above), not a blocklist: services appear in the catalog over time, and a blocklist lets each new one through until someone notices.
  • No bulk account creation. Cap open orders per customer and orders per customer per day.
  • Nothing for getting around bans, blocks or limits of a service, and no orders for accounts that belong to someone else.

A customer who asks for any of these is asking for something the panel does not do.

The software program for panels

A panel that sells to other people fits the platform's software program. From the partner portal, read on 2026-11-24: the software passes its own ID with each order; the program pays a percentage of every completed activation made through it, with no cap, while the software is active; the rate is set individually; connecting takes an application, a review of one business day and API access. Withdrawals start at $10, on request, in USDT (TRC-20) or USDC (BEP-20, Polygon).

Apply on the partner portal. The one parameter your order call gains is on For software owners.

ready to run it?

One key behind the panel, your price in front of it. Issue the key and price your first service.

Get an API key

Install for your coding agent

terminal
# Agent skills index: https://otpwatch.com/.well-known/agent-skills/index.json
npx skills add https://otpwatch.com

Two skills: receiving an SMS code in your own app or test, and building a bot that sells numbers. Index: /.well-known/agent-skills/index.json

Updated · prices from the 24 Nov 2026 snapshot