Enterprise-grade agentic document processing API. Accurately extracts key fields and line items from invoices, receipts, orders and more across 10+ file formats, with confidence scoring. Zero-configuration, fast integration. Professionally optimized on massive enterprise documents.
Agentic Document Processing API — convert 10+ file formats(.jpeg,.jpg,.png,.bmp,.tiff,.pdf,.doc,.docx,.xls,.xlsx) to structured JSON/Excel with per-field confidence scores using VLM and LLM.
Base URL:
https://adp-global.laiye.com/?utm_source=github
curl -X POST "https://adp-global.laiye.com/open/agentic_doc_processor/laiye/v1/app/doc/extract" \
-H "Content-Type: application/json" \
-H "X-Access-Key: $ADP_ACCESS_KEY" \
-H "X-Timestamp: $(date +%s)" \
-H "X-Signature: $(uuidgen)" \
-d '{
"app_key": "$ADP_APP_KEY",
"app_secret": "$ADP_APP_SECRET",
"file_url": "https://example.com/invoice.pdf"
}'
Response:
{
"status": "success",
"extraction_result": [
{
"field_key": "invoice_number",
"field_value": "INV-2024-001",
"field_type": "text",
"confidence": 0.95,
"source_pages": [1]
},
{
"field_key": "total_amount",
"field_value": "1000.00",
"field_type": "number",
"confidence": 0.98,
"source_pages": [1]
}
]
}
# Contact ADP service provider to obtain:
# - app_key: Application access key
# - app_secret: Application secret key
# - X-Access-Key: Tenant-level access key
Save your credentials:
export ADP_ACCESS_KEY="your_access_key_here"
export ADP_APP_KEY="your_app_key_here"
export ADP_APP_SECRET="your_app_secret_here"
Recommended: Use environment variables (most secure):
{
skills: {
entries: {
"adp-doc-extraction": {
enabled: true,
// API credentials loaded from environment variables
},
},
},
}
Security Note:
chmod 600 ~/.openclaw/openclaw.jsoncurl -X POST "https://adp-global.laiye.com/open/agentic_doc_processor/laiye/v1/app/doc/extract" \
-H "Content-Type: application/json" \
-H "X-Access-Key: $ADP_ACCESS_KEY" \
-H "X-Timestamp: $(date +%s)" \
-H "X-Signature: $(uuidgen)" \
-d '{
"app_key": "'"$ADP_APP_KEY"'",
"app_secret": "'"$ADP_APP_SECRET"'",
"file_url": "https://example.com/document.pdf"
}'
# Convert file to base64
file_base64=$(base64 -i document.pdf | tr -d '\n')
curl -X POST "https://adp-global.laiye.com/open/agentic_doc_processor/laiye/v1/app/doc/extract" \
-H "Content-Type: application/json" \
-H "X-Access-Key: $ADP_ACCESS_KEY" \
-H "X-Timestamp: $(date +%s)" \
-H "X-Signature: $(uuidgen)" \
-d "{
\"app_key\": \"$ADP_APP_KEY\",
\"app_secret\": \"$ADP_APP_SECRET\",
\"file_base64\": \"$file_base64\",
\"file_name\": \"document.pdf\"
}"
curl -X POST "https://adp-global.laiye.com/open/agentic_doc_processor/laiye/v1/app/doc/extract" \
-H "Content-Type: application/json" \
-H "X-Access-Key: $ADP_ACCESS_KEY" \
-H "X-Timestamp: $(date +%s)" \
-H "X-Signature: $(uuidgen)" \
-d '{
"app_key": "'"$ADP_APP_KEY"'",
"app_secret": "'"$ADP_APP_SECRET"'",
"file_url": "https://example.com/document.pdf",
"with_rec_result": true
}'
Access VLM results: response["doc_recognize_result"]
Create extraction task:
curl -X POST "https://adp-global.laiye.com/open/agentic_doc_processor/laiye/v1/app/doc/extract/create/task" \
-H "Content-Type: application/json" \
-H "X-Access-Key: $ADP_ACCESS_KEY" \
-H "X-Timestamp: $(date +%s)" \
-H "X-Signature: $(uuidgen)" \
-d '{
"app_key": "'"$ADP_APP_KEY"'",
"app_secret": "'"$ADP_APP_SECRET"'",
"file_url": "https://example.com/large-document.pdf"
}'
# Returns: {"task_id": "task_id_value", "metadata": {...}}
Poll for results:
curl -X GET "https://adp-global.laiye.com/open/agentic_doc_processor/laiye/v1/app/doc/extract/query/task/{task_id}" \
-H "X-Access-Key: $ADP_ACCESS_KEY"
Enhance VLM quality with higher resolution:
# model_params: { "scale": 2.0 }
Use a specific extraction configuration:
# model_params: { "version_id": "config_version_id" }
Get VLM results without extraction:
curl -X POST "https://adp-global.laiye.com/open/agentic_doc_processor/laiye/v1/app/doc/recognize" \
-H "Content-Type: application/json" \
-H "X-Access-Key: $ADP_ACCESS_KEY" \
-H "X-Timestamp: $(date +%s)" \
-H "X-Signature: $(uuidgen)" \
-d '{
"app_key": "'"$ADP_APP_KEY"'",
"app_secret": "'"$ADP_APP_SECRET"'",
"file_url": "https://example.com/document.pdf"
}'
| Document Size | Endpoint | Notes |
|---|---|---|
| Small files | /doc/extract (sync) | Immediate response |
| Large files | /doc/extract/create/task (async) | Poll for results |
File Input:
file_url: Prefer for large files (already hosted)file_base64: Use for direct upload (max 20MB)Confidence Scores:
Response Structure:
extraction_result: Array of extracted fieldsdoc_recognize_result: VLM results (when with_rec_result=true)metadata: Processing info (pages, time, model){
"status": "success",
"message": "string",
"extraction_result": [
{
"field_key": "string",
"field_value": "string",
"field_type": "text|number|date|table",
"confidence": 0.95,
"source_pages": [1],
"table_data": [...] // for field_type="table"
}
],
"doc_recognize_result": [...], // when with_rec_result=true
"extract_config_version": "string",
"metadata": {
"total_pages": 5,
"processing_time": 8.2,
"model_used": "gpt-4o"
}
}
{
"detail": "Error message description"
}
Extracts: invoice_number, invoice_date, vendor/customer_name, currency, vat_rate, total_amount_including_tax, total_amount_excluding_tax, line_items, etc.
Extracts: order_number, order_date, buyer_name/seller_name, address, total_amount, line_items, etc.
Important: Documents uploaded to ADP are transmitted to https://adp-global.laiye.com/?utm_source=github and processed on external servers.
Before uploading sensitive documents:
Best practices:
"your_access_key_here" in examples| Processing Stage | Cost |
|---|---|
| Document Parsing | 0.5 credits/page |
| Purchase Order Extraction | 1.5 credits/page |
| Invoice/Receipt Extraction | 1.5 credits/page |
| Custom Extraction | 1 credit/page |
New users: 100 free credits per month, no application restrictions.
| Error Code | Description | Common Causes & Solutions |
|---|---|---|
| 400 Bad Request | Invalid request parameters | • Missing app_key or app_secret<br>• Must provide exactly one input: file_url or file_base64<br>• Application has no published extraction config |
| 401 Unauthorized | Authentication failed | • Invalid X-Access-Key<br>• Incorrect timestamp format (use Unix timestamp)<br>• Invalid signature format (must be UUID) |
| 404 Not Found | Resource not found | • Application does not exist<br>• No published extraction config found for the application |
| 500 Internal Server Error | Server-side processing error | • Document conversion failed<br>• VLM recognition timeout<br>• LLM extraction failure |
| Sync Timeout | Request processing timed out | • Large files should use async endpoint<br>• Poll /query/task/{task_id} for results |
Before publishing or updating this skill, verify:
package.json declares requiredEnv and primaryEnv for credentialspackage.json lists API endpoints in endpoints arraySKILL.md or package.json