Authentication | ការផ្ទៀងផ្ទាត់

All API endpoints require an API key. Include it in the request header:

X-API-Key: khocr_your_api_key_here

Or as a query parameter:

GET /api/v1/health?api_key=khocr_your_api_key_here
Contact chhinhsovath@gmail.com to request an API key for your organization.

Rate Limits

PlanRequests / minPages / month
Free10100
Standard505,000
Enterprise20050,000

Endpoints | ចំណុចភ្ជាប់

POST /api/v1/convert
Convert a PDF document to text, Word, or JSON format.

Parameters

ParameterTypeRequiredDescription
file File Required PDF file (max 50 MB)
output_format String Optional json, text, or docx (default: json)
force_ocr Boolean Optional Force OCR even for native PDFs (default: false)
priority String Optional high, normal, or low (default: normal)

Example: cURL

curl -X POST https://khmer-ocr.openplp.com/api/v1/convert \
  -H "X-API-Key: khocr_your_key" \
  -F "file=@document.pdf" \
  -F "output_format=json"

Example: Python

import requests

response = requests.post(
    "https://khmer-ocr.openplp.com/api/v1/convert",
    headers={"X-API-Key": "khocr_your_key"},
    files={"file": open("document.pdf", "rb")},
    data={"output_format": "json"},
)
result = response.json()
print(f"Job ID: {result['job_id']}")

Example: JavaScript

const formData = new FormData();
formData.append('file', fileInput.files[0]);
formData.append('output_format', 'json');

const response = await fetch('/api/v1/convert', {
    method: 'POST',
    headers: { 'X-API-Key': 'khocr_your_key' },
    body: formData,
});
const result = await response.json();
console.log('Job ID:', result.job_id);

Response

{
  "job_id": "a1b2c3d4e5f6",
  "status": "queued",
  "message": "PDF submitted for processing",
  "message_km": "ឯកសារ PDF បានដាក់សម្រាប់ដំណើរការ"
}
GET /api/v1/jobs/{job_id}
Check the status of a conversion job.
curl https://khmer-ocr.openplp.com/api/v1/jobs/a1b2c3d4e5f6 \
  -H "X-API-Key: khocr_your_key"
{
  "id": "a1b2c3d4e5f6",
  "status": "PROCESSING",
  "progress": 45.0,
  "task_type": "convert",
  "elapsed_seconds": 12.5
}
GET /api/v1/jobs/{job_id}/result
Get the result of a completed job.
GET /api/v1/usage
Get current usage statistics for your organization.
GET /api/v1/health
API health check — no authentication required.
GET /api/v1/models
List available OCR and AI models.

Error Codes | កូដកំហុស

CodeDescriptionការពិពណ៌នា
400Bad request (invalid file or parameters)សំណើមិនត្រឹមត្រូវ
401Invalid or missing API keyកូដ API មិនត្រឹមត្រូវ
403Insufficient permissionsសិទ្ធិមិនគ្រប់គ្រាន់
404Resource not foundរកមិនឃើញ
429Rate limit exceededការស្នើសុំច្រើនពេក
500Internal server errorកំហុសម៉ាស៊ីនមេ

Support | ជំនួយ

For API access and support, contact: chhinhsovath@gmail.com

Platform: khmer-ocr.openplp.com

វេទិកា OCR ខ្មែរ © 2026 — បច្ចេកវិទ្យា OCR ផលិតកម្ម