AksonOCR V2 API User Guide
AksonOCR Document AI - OCR Processor
AksonOCR V2 API provides advanced OCR (Optical Character Recognition) capabilities, powered by our latest model AksonOCR-preview. You can extract text and structured content from images and PDF documents with high accuracy and markdown output.
Key Features
- Extracts text content while maintaining document structure and hierarchy
- Preserves formatting like headers, paragraphs, lists, and tables
- Returns results in markdown format for easy parsing and rendering
- Handles complex layouts including multi-column text and mixed content
- Processes documents at scale with high accuracy
- Supports multiple document formats:
image_url: PNG, JPEG/JPG, WEBP, and moredocument_url: PDF and images (via URL or base64)- Base64-encoded images and PDFs
Endpoints
1. /api/v2/ocr (URL Upload)
Protected endpoint for OCR processing. Requires API key authentication.
Features
- API key authentication required
- Max 50 pages for PDFs
- Per-page credit charging (0.1 credits per page)
- API-based rate limiting
Supported Input Formats
- Image URLs (PNG, JPG, WEBP)
- Document URLs (PDF or images)
- Base64-encoded images
- Base64-encoded PDFs
Credits
- Single image: 0.1 credits
- Multi-page PDF: 0.1 × number of pages
Example Requests
OCR with Image URL
curl -X POST 'https://backend.aksonocr.com/api/v2/ocr' \
-H 'X-API-Key: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"model": "AksonOCR-preview",
"document": {
"type": "image_url",
"image_url": "https://example.com/receipt.png"
}
}'
OCR with PDF URL
curl -X POST 'https://backend.aksonocr.com/api/v2/ocr' \
-H 'X-API-Key: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"model": "AksonOCR-preview",
"document": {
"type": "document_url",
"document_url": "https://arxiv.org/pdf/2201.04234.pdf",
"document_name": "research_paper.pdf"
},
"pages": [0, 2, 5]
}'
OCR with Base64 Image
curl -X POST 'https://backend.aksonocr.com/api/v2/ocr' \
-H 'X-API-Key: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"model": "AksonOCR-preview",
"document": {
"type": "document_url",
"document_url": "data:image/png;base64,iVBORw0KGgoAAAANS..."
}
}'
OCR with Base64 PDF
curl -X POST 'https://backend.aksonocr.com/api/v2/ocr' \
-H 'X-API-Key: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"model": "AksonOCR-preview",
"document": {
"type": "document_url",
"document_url": "data:application/pdf;base64,JVBERi0xLjQKJeLjz9MK..."
}
}'
Example Response
{
"model": "AksonOCR-preview",
"pages": [
{
"index": 0,
"markdown": "# Invoice\n\n**Invoice Number:** INV-2025-001\n**Date:** 2025-10-29\n..."
}
],
"usage": {
"pages_processed": 1
}
}
2. /api/v2/upload (File Upload)
Upload endpoint for images and PDFs. Use this to upload files for OCR processing.
Features
- Accepts image files (PNG, JPG, WEBP) and PDFs
- Max file size: 10MB
- For PDFs, max 50 pages
- Returns extracted text in markdown format
Example Request (Image Upload)
curl -X POST 'https://backend.aksonocr.com/api/v2/upload' \
-H 'X-API-Key: <YOUR_API_KEY>' \
-F 'file=@/path/to/image.png' \
-F 'model=AksonOCR-preview'
Example Request (PDF Upload)
curl -X POST 'https://backend.aksonocr.com/api/v2/upload' \
-H 'X-API-Key: <YOUR_API_KEY>' \
-F 'file=@/path/to/document.pdf' \
-F 'model=AksonOCR-preview'
Example Response
{
"model": "AksonOCR-preview",
"pages": [
{
"index": 0,
"markdown": "# Invoice\n\n**Invoice Number:** INV-2025-001\n**Date:** 2025-10-29\n..."
}
],
"usage": {
"pages_processed": 1
}
}
Notes
- Make sure your URLs are public and accessible by the API
- Only use supported formats for best results
- All results are returned in markdown for easy parsing
- For any issues, refer to error codes in the response
Error Codes
MODEL_NOT_FOUND: Model parameter is invalidINVALID_INPUT: No file provided or invalid inputPDF_CONVERSION_ERROR: Failed to process PDF fileINSUFFICIENT_CREDITS: Not enough credits for processingRATE_LIMIT_EXCEEDED: Too many requestsPROCESSING_ERROR: Internal server error
For further help, contact support or see the full API documentation.