LektApi Documentation
Comprehensive guide to using the LektApi services for document intelligence and data processing.
About LektApi
LektApi is a comprehensive document intelligence and data processing API service developed by Lekt-Tech. This service provides advanced AI-powered capabilities for enterprise document processing and business intelligence requirements.
Core API Services
Document Intelligence
- Optical Character Recognition (OCR)
- Intelligent data extraction
- Document classification
- Layout analysis and table extraction
- Multi-language text recognition
Data Processing
- JSON data transformation
- Text string normalization
- Keyword extraction & analysis
- Data validation & cleansing
- Content moderation
Supported Languages
Supported File Formats
Authentication
LektApi uses Bearer token authentication. You need to include your API key in the Authorization header of every request.
Getting Your API Key
- Navigate to the API Keys section in your dashboard
- Click "Create API Key" and provide a descriptive name
- Copy the generated API key (keep it secure!)
Making Authenticated Requests
curl -X POST "https://api.lekttech.com/v1/ocr" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "file=@document.pdf"
Rate Limiting
API requests are rate-limited based on your service tier:
- Tier 1: 25 RPS (Requests Per Second)
- Tier 2: 50 RPS
- Tier 3: 100 RPS
- Tier 4: 150 RPS
- Tier 5: 200 RPS
- Tier 6: 500 RPS
- Tier 7: 750 RPS
API Keys
Number of API keys available per tier:
- Tier 1: Up to 3 production + 3 development keys
- Tier 2-3: Up to 5 production + 5 development keys
- Tier 4: Up to 6 production + 6 development keys
- Tier 5: Up to 7 production + 7 development keys
- Tier 6: Up to 10 production + 10 development keys
- Tier 7: Up to 15 production + 15 development keys
API Endpoints
POST /v1/ocr
Extract text from images and documents using advanced OCR technology.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
file |
file | Yes | Image or PDF file to process |
language |
string | No | Language code (default: auto-detect) |
format |
string | No | Output format: text, json (default: text) |
Response Example
{
"success": true,
"text": "Extracted text content...",
"confidence": 0.95,
"language": "en",
"processing_time": 1.23
}
POST /v1/extract
Extract structured data from documents like invoices, contracts, and forms.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
file |
file | Yes | Document to extract data from |
document_type |
string | No | invoice, contract, form (default: auto) |
fields |
array | No | Specific fields to extract |
POST /v1/transform
Transform and restructure JSON data with advanced mapping capabilities.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data |
object | Yes | JSON data to transform |
mapping |
object | Yes | Transformation mapping rules |
validate |
boolean | No | Validate output (default: true) |
POST /v1/text2image
Generate images from text descriptions using AI.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
prompt |
string | Yes | Text description of image to generate |
width |
integer | No | Image width in pixels (default: 512) |
height |
integer | No | Image height in pixels (default: 512) |
style |
string | No | Art style: realistic, cartoon, abstract |
Code Examples
Python
import requests
# OCR Example
url = "https://api.lekttech.com/v1/ocr"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
files = {"file": open("document.pdf", "rb")}
response = requests.post(url, headers=headers, files=files)
result = response.json()
print(f"Extracted text: {result['text']}")
JavaScript (Node.js)
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const form = new FormData();
form.append('file', fs.createReadStream('document.pdf'));
axios.post('https://api.lekttech.com/v1/ocr', form, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
...form.getHeaders()
}
})
.then(response => {
console.log('Extracted text:', response.data.text);
})
.catch(error => {
console.error('Error:', error.response.data);
});
cURL
# OCR Request
curl -X POST "https://api.lekttech.com/v1/ocr" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@document.pdf" \
-F "language=en" \
-F "format=json"
# JSON Transform Request
curl -X POST "https://api.lekttech.com/v1/transform" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {"name": "John", "age": 30},
"mapping": {"fullName": "name", "years": "age"}
}'
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lekttech.com/v1/ocr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY"
],
CURLOPT_POSTFIELDS => [
"file" => new CURLFile("document.pdf")
]
]);
$response = curl_exec($curl);
$result = json_decode($response, true);
echo "Extracted text: " . $result['text'];
curl_close($curl);
?>
Service Tiers & Pricing
Choose the tier that best fits your needs. All prices are in EUR and billed monthly.
Rate Limit Definitions
RPD: Requests Per Day (daily limit)
Burst: Short-term increased capacity
Tier 1
€2,000
per month
- 25 RPS
- 100K RPD
- 3M monthly requests
- 50 RPS burst (1 min)
- 3 prod + 3 dev API keys
Tier 2
€4,000
per month
- 50 RPS
- 250K RPD
- 7M monthly requests
- 100 RPS burst (2 min)
- 5 prod + 5 dev API keys
Tier 3
€8,000
per month
- 100 RPS
- 500K RPD
- 15M monthly requests
- 200 RPS burst (3 min)
- 5 prod + 5 dev API keys
Tier 4
€10,000
per month
- 150 RPS
- 750K RPD
- 22M monthly requests
- 300 RPS burst (3 min)
- 6 prod + 6 dev API keys
Tier 5
€12,000
per month
- 200 RPS
- 1M RPD
- 30M monthly requests
- 400 RPS burst (4 min)
- 7 prod + 7 dev API keys
Tier 6
€15,000
per month
- 500 RPS
- 2M RPD
- 60M monthly requests
- 1K RPS burst (5 min)
- 10 prod + 10 dev API keys
Tier 7
€20,000
per month
- 750 RPS
- 3M RPD
- 90M monthly requests
- 1.5K RPS burst (5 min)
- 15 prod + 15 dev API keys