# PilotKYC — Complete Developer & Integration Reference > Pay-per-verification identity verification API: Document OCR + ICAO 9303 MRZ validation (0.04 USDT), Biometric Face Match + Passive Liveness (0.08 USDT), AML/Sanctions Screening, Zero-Retention privacy, HMAC-SHA256 signed webhooks, and MCP server access. Zero monthly minimums. - **Marketing & Dashboard Host:** `https://pilotkyc.com` - **Public API Base URL:** `https://api.pilotkyc.com/v1` - **Hosted Verification Host:** `https://verify.pilotkyc.com` - **MCP Endpoint:** `https://api.pilotkyc.com/mcp` - **OpenAPI Spec:** `https://pilotkyc.com/docs/openapi.yaml` - **Comparison Guide:** `https://pilotkyc.com/compare/` - **Telegram Community:** `https://t.me/pilotbotnet` --- ## 1. Pricing & Billing Model - **Sandbox (`pk_test_` keys):** Free (`0` USDT). Unlimited test sessions and deterministic outcomes (`DECLINE`, `REVIEW`, `UNREADABLE`, or default `approved`). - **Document check (`mode: "document"`):** **0.04 USDT** per live verification. Validates presence, document authenticity signals, multi-script OCR (Latin & Cyrillic), ICAO 9303 MRZ check digits, and optional `expected_name` match. - **Selfie + Document (`mode: "selfie_document"`):** **0.08 USDT** per live verification. Includes everything in `document`, plus 1:1 biometric face comparison and single-frame passive liveness detection against screen/print spoofing. - **Billing mechanism:** Prepaid USDT (TRC-20 / ERC-20 via OxaPay, 10–5000 USDT top-ups). No monthly subscriptions or minimums (`$0/mo`). - `POST /v1/checks` charges immediately after image validation and auto-refunds if our engine fails. - `POST /v1/sessions` places an atomic hold at creation, captures when the user submits images, and releases automatically if the session expires or is canceled. --- ## 2. Authentication & API Keys - Pass `Authorization: Bearer ` on every `/v1/*` request. - `pk_test_...`: sandbox mode (free, deterministic scenarios). - `pk_live_...`: live production mode (requires verified email and funded USDT balance). - Scoped API keys support fine-grained permissions, IP allowlists, workflow restrictions, and optional TTL expiration. - **MCP OAuth 2.0:** AI agents (Claude, ChatGPT, custom clients) can connect to `https://api.pilotkyc.com/mcp` using OAuth 2.0 PKCE or scoped Bearer tokens. --- ## 3. REST API Endpoints (`/v1`) | Method | Path | Description | |---|---|---| | `POST` | `/v1/sessions` | Create a hosted verification session (supports `Idempotency-Key`) | | `GET` | `/v1/sessions` | List sessions (`reference_id`, `status`, `limit`, `starting_after`) | | `GET` | `/v1/sessions/{id}` | Retrieve a session and its decision/scores | | `POST` | `/v1/sessions/{id}/cancel` | Cancel a `created` session and release held balance | | `DELETE` | `/v1/sessions/{id}/data` | Erase extracted personal data (`data_erased: true`) | | `POST` | `/v1/sessions/{id}/webhooks/resend` | Re-send the last webhook event for a session | | `POST` | `/v1/checks` | Synchronous direct check via `multipart/form-data` | | `GET` | `/v1/checks/{id}` | Retrieve a direct check result | ### Supported Document Types & Languages - **`allowed_document_types`:** `passport`, `internal_passport`, `national_id`, `driver_license`, `residence_permit` - **Hosted page languages (`language`):** `en`, `ru`, `th`, `vi`, `pt`, `es`, `zh` - **Decisions:** `approved`, `declined`, `review` (`null` while pending) - **Session statuses:** `created`, `in_progress`, `processing`, `approved`, `declined`, `review`, `expired`, `canceled` --- ## 4. Quickstart Example ```bash curl -X POST https://api.pilotkyc.com/v1/sessions \ -H "Authorization: Bearer pk_test_YOUR_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: order-1842-kyc" \ -d '{ "mode": "selfie_document", "reference_id": "user-1842", "expected_name": "Nguyen Van A", "language": "en", "callback_url": "https://example.com/webhooks/pilotkyc", "redirect_url": "https://example.com/kyc/done" }' ``` Send the user to `session.url` (e.g. `https://verify.pilotkyc.com/s/ses_...`). For desktop sessions, the hosted flow provides an instant QR code to continue on a smartphone camera without requiring any custom WebRTC/camera frontend code. --- ## 5. Result Object Schema ```json { "id": "ses_2b9f...", "object": "session", "livemode": true, "mode": "selfie_document", "status": "approved", "url": "https://verify.pilotkyc.com/s/ses_2b9f...", "reference_id": "user-1842", "decision": "approved", "reasons": [], "document": { "name": "NGUYEN VAN A", "date_of_birth": "1990-04-12", "document_number": "C1234567", "nationality": "VNM", "expiry_date": "2031-02-03", "mrz_checked": true }, "scores": { "document_authenticity": 0.86, "name_match": 0.97, "face_match": 0.81, "liveness": 0.90 }, "price": { "amount": "0.080000", "currency": "USDT" }, "data_erased": false } ``` ### Decision Reason Codes `document_not_found`, `document_unreadable`, `document_incomplete`, `document_suspicious`, `document_expired`, `document_expiry_unknown`, `mrz_invalid`, `name_mismatch`, `face_not_found`, `face_mismatch`, `liveness_failed`, `low_document_quality`, `low_face_match`, `low_liveness`, `engine_error`. --- ## 6. Webhook Verification (`PilotKYC-Signature`) Every webhook request (`session.in_progress`, `session.completed`, `session.expired`, `session.canceled`, `session.reviewed`) carries: ``` PilotKYC-Signature: t=,v1= ``` Verify in constant time against the **raw request bytes** before JSON parsing: ```python import hashlib, hmac, time def verify_pilotkyc_signature(raw_body: bytes, header: str, secret: str) -> bool: parts = dict(item.strip().split("=", 1) for item in header.split(",") if "=" in item) ts, sig = parts.get("t", ""), parts.get("v1", "") if not ts.isdigit() or abs(time.time() - int(ts)) > 300: return False expected = hmac.new(secret.encode(), ts.encode() + b"." + raw_body, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, sig) ``` Failed non-2xx deliveries retry up to 8 times with exponential backoff (10 seconds to 6 hours). --- ## 7. Zero-Retention Privacy, AML Screening & Telegram Mini Apps - **Zero-Retention:** Raw document and selfie images live only in transient memory/short-lived buffers while recognition runs and are automatically deleted after completion. Extracted document text fields default to 30-day retention or instant removal via `DELETE /v1/sessions/{id}/data`. - **Sanctions & Watchlists:** Screening covers OFAC SDN, UN Security Council 1267, EU Financial Sanctions, Rosfinmonitoring, and Interpol Red Notices. - **Telegram Mini App & P2P Escrow:** Integrate via hosted `verify_url` inside Telegram WebView or share Permanent Verification Links (`/l/{slug}`) with signed `ref` parameters; forward verification dossiers directly to a team Telegram chat/topic via the Dashboard Telegram Archive integration.