API Documentation

AILA Tech API Reference

Everything you need to integrate AI identity verification into your product. Get your first API call working in minutes.

7 APIs Production Ready application/json Base64 Files
Base URL: https://www.ailatech.la/api/v1/services/

Authentication required

Include your API token in every request: "token": "YOUR_AILA_TOKEN" inside the Header object.

Get Token

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 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.

POST /aila-face-anti-spoofing/verify application/json
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"
        }
      }
    }
  }'
Response
{
  "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.

POST /aila-face-recognition/register application/json
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.

POST /aila-personal-id-card/extract-data application/json
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"
        }
      }
    }
  }'
Response
{
  "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.

POST /aila-ocr/lao application/json
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.

POST /aila-license-plate/detection application/json
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..."
        }
      }
    }
  }'
Response
{ "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.

POST /aila-e-kyc/new-customer application/json
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"
        }
      }
    }
  }'
Response
{
  "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.

POST /aila-api/check-package application/json
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"}}
  }'
Response
{
  "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.

Ready to integrate?

Try the endpoints live in your browser or sign up for an API token to start building.