Official TypeScript, JavaScript, and Python SDKs for the SMSCode virtual-number API.
Rent temporary phone numbers, receive OTP/SMS verification codes, and automate phone verification flows.
- One public API contract for TypeScript/JavaScript and Python, validated against the same OpenAPI source.
- Money-safe order creation with idempotency keys, typed errors, and retry behavior designed for paid API calls.
- OTP lifecycle helpers for waiting, resending, finishing, canceling no-OTP orders, and verifying webhook signatures.
/v2USD-native API by default, with the legacy/v1IDR API still available where needed.
| Package | Runtime | Registry | Install | Docs |
|---|---|---|---|---|
@smscode/sdk |
TypeScript / JavaScript | npm | bun add @smscode/sdk or npm i @smscode/sdk |
README |
smscode |
Python 3.10+ | PyPI | pip install smscode |
README |
npm i @smscode/sdkimport { SmscodeClient } from "@smscode/sdk";
const client = new SmscodeClient({ token: process.env.SMSCODE_TOKEN! });
const { balance } = await client.balance.get();
console.log(`USD balance: ${balance.amount}`);pip install smscodeimport os
from smscode import SmscodeClient
with SmscodeClient(token=os.environ["SMSCODE_TOKEN"]) as client:
balance = client.balance.get()
print(f"USD balance: {balance.balance.amount}")- Catalog lookup for countries, services, products, and exchange rates.
- Balance reads on
/v2and/v1. - Order create, list, get, cancel, finish, resend, and active-order lookup.
- OTP polling with stale-code protection after resend (
afterCode/after_code). - Webhook get/update/test plus raw-body signature verification helpers.
- Typed error classes for validation, auth, rate limit, timeout, terminal order, and money/idempotency failures.
- OpenAPI contract (machine-readable): https://smscode.gg/openapi.yaml
- AI-agent integration guide: https://smscode.gg/docs/ai.md
- Website: https://smscode.gg
- GitHub releases: https://github.com/smscode-gg/sdks/releases
packages/sdk-js/ TypeScript/JavaScript SDK
packages/sdk-py/ Python SDK
docs/ Public API and AI-agent documentation
scripts/ Contract and release verification helpers
MIT — see LICENSE.