Skip to content

Alaikis BI API Documentation

Welcome to the Alaikis Business Intelligence API platform. This comprehensive API suite provides intelligent solutions for logistics optimization, product traceability, address parsing, and text classification.

Overview

The Alaikis BI API is a RESTful API platform built with FastAPI, offering multiple AI-powered services:

  • Packing Optimization: 3D bin packing with AI-enhanced algorithms
  • Product Traceability: Image-based product verification with barcode and OCR
  • Address Parsing: Multi-language address parsing and normalization
  • Text Classification: Shipping status and text classification

Base URL

https://api.alaikis.com

For local development:

http://localhost:8000

Authentication

The API uses two authentication methods:

1. JWT Bearer Token (Web Interface)

For interactive web sessions, obtain a JWT token via the OAuth2 flow:

bash
GET /auth/login

After successful authentication, include the token in requests:

bash
Authorization: Bearer <your-jwt-token>

2. API Key (Machine-to-Machine)

For server-to-server communication, use API keys in the Authorization header:

bash
Authorization: Bearer <your-api-key>

API Key Management

API keys can be created and managed through the /api/tokens endpoints. Each key is associated with a user and can be revoked at any time.

Quick Start

1. Obtain Authentication

python
import requests

# For API key authentication
headers = {
    "Authorization": "Bearer your-api-key",
    "Content-Type": "application/json"
}

2. Make Your First Request

python
# Health check
response = requests.get("https://api.alaikis.com/health")
print(response.json())
# Output: {"status": "healthy"}

3. Try Packing Calculation

python
payload = {
    "skus": [{
        "id": "SKU001",
        "weight": 2.5,
        "length": 20,
        "width": 15,
        "height": 10,
        "quantity": 10
    }],
    "pallets": [{
        "id": "PAL001",
        "length": 120,
        "width": 100,
        "height": 150,
        "max_weight": 1000,
        "cost": 5.0
    }]
}

response = requests.post(
    "https://api.alaikis.com/api/packing/calculate",
    json=payload,
    headers=headers
)
result = response.json()

Core Services

Packing Optimization API

The Packing Optimization API uses a 3-layer hybrid architecture to compute optimal 3D bin packing solutions:

  • Layer 1: Rule Engine - deterministic constraint handling
  • Layer 2: AI Model - intelligent SKU-pallet matching
  • Layer 3: OR-Tools - mathematical optimization guarantees

Key Features:

  • Multiple pallet types support
  • Weight and dimension constraints
  • Dangerous goods isolation
  • Pre-assigned pallets support
  • Vehicle utilization calculation
  • Learn more →

Product Trace API

The Product Trace API provides image-based product verification with multi-modal feature extraction:

  • Barcode Detection: Fast barcode scanning and matching
  • OCR Extraction: Text extraction from product images
  • Visual Features: DINOv2 ViT-S/14 global and patch-level features
  • Multi-Image Fusion: Combined features from multiple angles

Key Features:

  • Synchronous and asynchronous processing
  • Hash-Only Mode (default) for millisecond-level deterministic matching
  • Legacy visual similarity mode for probability-based matching
  • ANN-based fast similarity search
  • Processing status tracking
  • Learn more →

Address Parsing API

The Address Parsing API parses and normalizes address strings from multiple countries:

  • Supported Countries: US, GB, NL, DE, FR, CN, AU, BE
  • Information Extraction: Names, phones, emails, companies
  • Batch Processing: Multiple addresses in one request
  • Address Expansion: Generate address variants

Learn more →

Text Classification API

The Classification API classifies shipping status and other text categories:

  • Multi-language Support: Automatic language detection
  • Caching Results: Redis-based response caching
  • Custom Models: Support for custom classification models

Learn more →

Versioning

The API supports multiple versions simultaneously. Current version: v1

bash
# Versioned endpoints
/api/v1/packing/calculate
/api/v1/product-trace/record

# Unversioned (latest)
/api/packing/calculate

Rate Limiting

API requests are subject to rate limits:

TierRequests/minuteConcurrent Requests
Free605
Basic30020
Enterprise1000100

Response Formats

All API responses use JSON format with consistent structure:

Success Response

json
{
    "success": true,
    "data": { /* response data */ },
    "message": "Operation completed successfully"
}

Error Response

json
{
    "success": false,
    "error": {
        "code": "VALIDATION_ERROR",
        "message": "Invalid request parameters",
        "details": []
    }
}

Learn more about error handling →

OpenAPI Specification

Interactive API documentation is available:

  • Swagger UI: /docs
  • Redoc: /redoc
  • OpenAPI JSON: /openapi.json

SDKs

Official SDKs are available for multiple programming languages:

Support

For technical support: