AILA Tech API Reference
Everything you need to integrate AI identity verification into your product. Get your first API call working in minutes.
Available APIs
Production-ready AI services. All use application/json with base64-encoded files. Click any card to jump to its code sample.
Face Liveness
Detect real vs spoofed faces
AL_0201Face Recognition
Register, verify & find similar
AL_0301–0303ID Card OCR
White, green, digital & passport
AL_0601–0604Lao Text OCR
Extract text from documents
AL_0401License Plate
Detect & read plates
AL_0501–0502e-KYC
Customer onboarding via ID
AL_0101–0103Packages
Check & overview usage
AL_0702–0705Face Liveness Detection Try Live
Detect whether a face is live (real person) or spoofed. Supports image (AL_0201) and video (AL_0202). Files are sent as base64 inside a JSON body.
import requests, uuid, base64 from datetime import datetime with open("face.jpg", "rb") as f: img_b64 = base64.b64encode(f.read()).decode() payload = { "Header": { "type": "RQ", "token": AILA_TOKEN, "product": "AL_0201", # AL_0202 for video "datetime": str(int(datetime.now().timestamp())), "uuid": str(uuid.uuid4()) }, "Body": { "input_data": { "user_id": USER_ID, "package_id": PACKAGE_ID, "prod_id": "PD01", "files": { "file_name": "face.jpg", "file_base64": img_b64 } } } } resp = requests.post(BASE_URL + "aila-face-anti-spoofing/verify", json=payload) print(resp.json())
// Helper: File → base64 string const toBase64 = f => new Promise((res, rej) => { const r = new FileReader(); r.onload = () => res(r.result.split(',')[1]); r.onerror = rej; r.readAsDataURL(f); }); const imgB64 = await toBase64(imageFile); // File from <input> const payload = { Header: { type: 'RQ', token: AILA_TOKEN, product: 'AL_0201', datetime: String(Date.now()), uuid: crypto.randomUUID() }, Body: { input_data: { user_id: USER_ID, package_id: PACKAGE_ID, prod_id: 'PD01', files: { file_name: imageFile.name, file_base64: imgB64 } } } }; const resp = await fetch(BASE_URL + 'aila-face-anti-spoofing/verify', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }); console.log(await resp.json());
curl -X POST "https://www.ailatech.la/api/v1/services/aila-face-anti-spoofing/verify" \ -H "Content-Type: application/json" \ -d '{ "Header": { "type": "RQ", "token": "your_aila_token", "product": "AL_0201", "datetime": "1714000000", "uuid": "550e8400-e29b-41d4-a716-446655440000" }, "Body": { "input_data": { "user_id": "your_user_id", "package_id": "your_package_id", "prod_id": "PD01", "files": { "file_name": "face.jpg", "file_base64": "BASE64_ENCODED_IMAGE" } } } }'
{
"is_live": true,
"confidence": 0.97,
"label": "real"
}
Face Recognition Try Live
Register faces into a database, verify a face matches a registered user, or find the most similar identity. All use application/json with base64 face images.
import base64 def b64(path): with open(path, "rb") as f: return base64.b64encode(f.read()).decode() payload = { "Header": { "type": "RQ", "token": AILA_TOKEN, "product": "AL_0301", "datetime": str(int(datetime.now().timestamp())), "uuid": str(uuid.uuid4()) }, "Body": { "input_data": { "user_id": USER_ID, "package_id": PACKAGE_ID, "prod_id": "PD01", "user_info": { "username": "user@email.com", "password": "password" }, "genneral_info": { "full_name_lao": "ລູກຄ້າ", "full_name_english": "Customer Name", "date_of_birth": "1999-09-09", "gender": "M", "natonality": "la", "country": "Laos", "address": "Vientiane" }, "identification_document": { "document_type": "identity", "document_number": "12345678", "date_of_issue": "2020-01-01", "date_of_expiry": "2030-12-31" }, "contact_info": { "email": "user@email.com", "phone": "20xxxxxxxx" }, "files": { "face1_name": "face1.jpg", "face1_base64": b64("face1.jpg"), "face2_name": "face2.jpg", "face2_base64": b64("face2.jpg"), "face3_name": "face3.jpg", "face3_base64": b64("face3.jpg") } } } } resp = requests.post(BASE_URL + "aila-face-recognition/register", json=payload) print(resp.json())
curl -X POST "https://www.ailatech.la/api/v1/services/aila-face-recognition/register" \ -H "Content-Type: application/json" \ -d '{ "Header": {"type":"RQ","token":"your_token","product":"AL_0301","datetime":"1714000000","uuid":"..."}, "Body": { "input_data": { "user_id":"your_id","package_id":"PK01","prod_id":"PD01", "user_info":{"username":"user@email.com","password":"password"}, "genneral_info":{"full_name_lao":"ລູກຄ້າ","full_name_english":"Name", "date_of_birth":"1999-09-09","gender":"M","natonality":"la", "country":"Laos","address":"Vientiane"}, "identification_document":{"document_type":"identity","document_number":"12345678", "date_of_issue":"2020-01-01","date_of_expiry":"2030-12-31"}, "contact_info":{"email":"user@email.com","phone":"20xxxxxxxx"}, "files":{ "face1_name":"face1.jpg","face1_base64":"BASE64...", "face2_name":"face2.jpg","face2_base64":"BASE64...", "face3_name":"face3.jpg","face3_base64":"BASE64..." } } } }'
ID Card & Passport OCR Try Live
One endpoint, four card types — white card (AL_0601), green card (AL_0602), digital card (AL_0603), passport (AL_0604). Set document_type to identity_card or passport.
with open("lao_id_card.jpg", "rb") as f: img_b64 = base64.b64encode(f.read()).decode() payload = { "Header": { "type": "RQ", "token": AILA_TOKEN, "product": "AL_0601", "datetime": str(int(datetime.now().timestamp())), "uuid": str(uuid.uuid4()) }, "Body": { "input_data": { "user_id": USER_ID, "package_id": PACKAGE_ID, "prod_id": "PD01", "files": { "document_type": "identity_card", # or "passport" "file_name": "lao_id_card.jpg", "file_base64": img_b64 } } } } resp = requests.post(BASE_URL + "aila-personal-id-card/extract-data", json=payload) data = resp.json() print(data)
const imgB64 = await toBase64(idCardFile); const payload = { Header: { type: 'RQ', token: AILA_TOKEN, product: 'AL_0601', datetime: String(Date.now()), uuid: crypto.randomUUID() }, Body: { input_data: { user_id: USER_ID, package_id: PACKAGE_ID, prod_id: 'PD01', files: { document_type: 'identity_card', // or 'passport' file_name: idCardFile.name, file_base64: imgB64 } } } }; const data = await (await fetch(BASE_URL + 'aila-personal-id-card/extract-data', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) })).json(); console.log(data);
curl -X POST "https://www.ailatech.la/api/v1/services/aila-personal-id-card/extract-data" \ -H "Content-Type: application/json" \ -d '{ "Header": {"type":"RQ","token":"your_token","product":"AL_0601","datetime":"1714000000","uuid":"..."}, "Body": { "input_data": { "user_id":"your_id","package_id":"PK01","prod_id":"PD01", "files": { "document_type": "identity_card", "file_name": "lao_id_card.jpg", "file_base64": "BASE64_ENCODED_IMAGE" } } } }'
{
"name": "ສົມສີ ດາວງ",
"id_number": "LA-123456",
"date_of_birth": "1990-01-01",
"expiry_date": "2030-01-01",
"nationality": "Lao"
}
Lao Text OCR Try Live
Extract text content from any Lao language document image (AL_0401). Send the file as a base64 string.
with open("document.png", "rb") as f: img_b64 = base64.b64encode(f.read()).decode() payload = { "Header": { "type": "RQ", "token": AILA_TOKEN, "product": "AL_0401", "datetime": str(int(datetime.now().timestamp())), "uuid": str(uuid.uuid4()) }, "Body": { "input_data": { "user_id": USER_ID, "package_id": PACKAGE_ID, "prod_id": "PD01", "files": { "file_name": "document.png", "file_base64": img_b64 } } } } resp = requests.post(BASE_URL + "aila-ocr/lao", json=payload) print(resp.json())
curl -X POST "https://www.ailatech.la/api/v1/services/aila-ocr/lao" \ -H "Content-Type: application/json" \ -d '{ "Header": {"type":"RQ","token":"your_token","product":"AL_0401","datetime":"1714000000","uuid":"..."}, "Body": { "input_data": { "user_id":"your_id","package_id":"PK01","prod_id":"PD01", "files": {"file_name":"document.png","file_base64":"BASE64..."} } } }'
License Plate Detection Try Live
Detect and read vehicle license plates from an image (AL_0501) or video (AL_0502). Set document_type to license_plate and country_code to LA.
with open("car.jpg", "rb") as f: img_b64 = base64.b64encode(f.read()).decode() payload = { "Header": { "type": "RQ", "token": AILA_TOKEN, "product": "AL_0501", # AL_0502 for video "datetime": str(int(datetime.now().timestamp())), "uuid": str(uuid.uuid4()) }, "Body": { "input_data": { "user_id": USER_ID, "package_id": PACKAGE_ID, "prod_id": "PD01", "files": { "country_code": "LA", "document_type": "license_plate", "file_name": "car.jpg", "file_base64": img_b64 } } } } resp = requests.post(BASE_URL + "aila-license-plate/detection", json=payload) print(resp.json())
curl -X POST "https://www.ailatech.la/api/v1/services/aila-license-plate/detection" \ -H "Content-Type: application/json" \ -d '{ "Header": {"type":"RQ","token":"your_token","product":"AL_0501","datetime":"1714000000","uuid":"..."}, "Body": { "input_data": { "user_id":"your_id","package_id":"PK01","prod_id":"PD01", "files": { "country_code":"LA","document_type":"license_plate", "file_name":"car.jpg","file_base64":"BASE64..." } } } }'
{ "plate_number": "ກທ 1234", "confidence": 0.95 }
e-KYC — New Customer Onboarding Try Live
Complete KYC in one call — verify a new customer using their Lao ID card (white AL_0101, green AL_0102, digital AL_0103). Send both the ID card and face photo as base64.
with open("id_card.jpg", "rb") as f: card_b64 = base64.b64encode(f.read()).decode() with open("face.jpg", "rb") as f: face_b64 = base64.b64encode(f.read()).decode() payload = { "Header": { "type": "RQ", "token": AILA_TOKEN, "product": "AL_0101", "datetime": str(int(datetime.now().timestamp())), "uuid": str(uuid.uuid4()) }, "Body": { "input_data": { "user_id": USER_ID, "package_id": PACKAGE_ID, "prod_id": "PD01", "files": { "document_type": "ID_CARD", "document_file_name": "id_card.jpg", "document_file_base64": card_b64, "face_type": "PHOTO", "face_file_name": "face.jpg", "face_file_base64": face_b64 } } } } resp = requests.post(BASE_URL + "aila-e-kyc/new-customer", json=payload) print(resp.json())
const cardB64 = await toBase64(idCardFile); const faceB64 = await toBase64(faceFile); const payload = { Header: { type: 'RQ', token: AILA_TOKEN, product: 'AL_0101', datetime: String(Date.now()), uuid: crypto.randomUUID() }, Body: { input_data: { user_id: USER_ID, package_id: PACKAGE_ID, prod_id: 'PD01', files: { document_type: 'ID_CARD', document_file_name: idCardFile.name, document_file_base64: cardB64, face_type: 'PHOTO', face_file_name: faceFile.name, face_file_base64: faceB64 } } } }; const data = await (await fetch(BASE_URL + 'aila-e-kyc/new-customer', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) })).json(); console.log(data);
curl -X POST "https://www.ailatech.la/api/v1/services/aila-e-kyc/new-customer" \ -H "Content-Type: application/json" \ -d '{ "Header": {"type":"RQ","token":"your_token","product":"AL_0101","datetime":"1714000000","uuid":"..."}, "Body": { "input_data": { "user_id":"your_id","package_id":"PK01","prod_id":"PD01", "files": { "document_type": "ID_CARD", "document_file_name": "id_card.jpg", "document_file_base64": "BASE64_ID_CARD_IMAGE", "face_type": "PHOTO", "face_file_name": "face.jpg", "face_file_base64": "BASE64_FACE_IMAGE" } } } }'
{
"status": "success",
"customer_id": "CUS-20260426-001",
"name": "ສົມສີ ດາວງ",
"id_number": "LA-123456",
"verified": true
}
Package Management
Check your API package balance or get an overview of all your packages. These endpoints do not require file uploads.
payload = {
"Header": {
"type": "RQ", "token": AILA_TOKEN, "product": "AL_0702",
"datetime": str(int(datetime.now().timestamp())), "uuid": str(uuid.uuid4())
},
"Body": {
"input_data": {
"user_id": USER_ID,
"package_id": PACKAGE_ID,
"prod_id": "PD01"
}
}
}
resp = requests.post(BASE_URL + "aila-api/check-package", json=payload)
print(resp.json())
curl -X POST "https://www.ailatech.la/api/v1/services/aila-api/check-package" \ -H "Content-Type: application/json" \ -d '{ "Header": {"type":"RQ","token":"your_token","product":"AL_0702","datetime":"1714000000","uuid":"..."}, "Body": {"input_data": {"user_id":"your_id","package_id":"PK01","prod_id":"PD01"}} }'
{
"package_id": "PK01",
"request_total": 1000,
"request_available": 750,
"request_usage": 250,
"expire_date": "2026-12-31"
}
All API Endpoints
All endpoints accept application/json with the {Header, Body} envelope. Files are sent as base64 strings — no multipart uploads needed.
Detect if a face is live or a spoof attack. Image (AL_0201) or video (AL_0202).
Verify a face matches a registered user. (AL_0302)
Register a new identity with 3 face photos. (AL_0301)
Find the most similar identity from the database. (AL_0303)
Extract text from Lao language documents. (AL_0401)
Extract fields from Lao ID cards (white/green/digital) and passports. (AL_0601–0604)
Detect and read vehicle license plate numbers. (AL_0501 / AL_0502)
e-KYC onboarding — ID card + face photo together. (AL_0101–0103)
Check remaining API balance for a specific package. (AL_0702)
Get usage overview across all your API packages. (AL_0705)
Ready to integrate?
Try the endpoints live in your browser or sign up for an API token to start building.