微算力 · API 导航与自营网关
API 接入 EN
未登录登录
📄

智能票据提取,一键结构化

Laiye-OCR · v1.1.1
入口已确认,内容待校验 文件树里有 SKILL.md,但正文还没采回,frontmatter 未核对。
办公 安全 B 级 作者 laiye-adp 公开目录收录
1.1k 下载 3 安装 3.8k 收藏 27 浏览

简介

企业级智能文档处理API,支持10+格式票据发票结构化提取,含置信度评分,零配置快速集成,每月100免费积分

原始描述

Enables AI-powered parsing and key information extraction from high-frequency documents including invoices, orders, receipts, long texts, and common Chinese...

通过你的 Agent 添加

安装目录:laiye-ocr/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/laiye-ocr/
Codex CLI~/.codex/skills/laiye-ocr/
DeepSeek Harness~/.agents/skills/laiye-ocr/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

Laiye ADP 是一款基于 VLM+LLM 的企业级智能文档处理 API,支持将 JPEG、PNG、PDF、Word、Excel 等 10 余种格式的发票、收据、订单等商业文档自动转换为结构化 JSON/Excel 数据。用户通过 HTTPS POST 请求提交文档(URL 或 Base64),API 返回包含字段键值、数据类型、置信度分数及来源页码的标准化结果。

集成流程极简:获取 App Key/App Secret/X-Access-Key 三组凭证后,即可调用 /doc/extract 同步接口或 /doc/extract/create/task 异步接口。异步模式专为大型文档设计,通过 task_id 轮询获取结果。高级功能包括:自定义 scale 参数提升 VLM 识别精度、指定配置版本、单独调用文档识别端点等。

显著优点

格式兼容性卓越:原生支持扫描件、电子文档、表格混合场景,无需 OCR 预处理。置信度驱动的工作流:每个字段返回 0-1 置信度分数,低于 0.8 自动标记待人工复核,显著降低财务风险。企业级架构:异步任务队列、10 分钟超时保护、2 并发(付费版),满足批量处理需求。成本友好:新用户每月 100 免费积分,按页计费(解析 0.5 积分,提取 1-1.5 积分),透明可预测。

潜在局限

数据出境风险:文档上传至 adp-global.laiye.com 境外服务器处理,敏感财务数据需评估合规性。黑箱模型:依赖 GPT-4o 等闭源大模型,字段提取逻辑不可解释,罕见版式可能出现幻觉。格式限制:单文件 50MB/20MB(Base64) 上限,不支持视频/音频;免费版仅 1 并发。生态锁定:配置版本、自定义提取规则需依赖厂商控制台,缺乏开源替代方案。

适合人群

  • 财务/会计团队:自动化发票录入、三单匹配、费用报销审核
  • 采购/供应链:采购订单数字化、供应商对账
  • SaaS 开发者:快速集成 OCR+LLM 能力,无需自建 ML pipeline
  • 中型企业:无专职 AI 团队,需要零配置即插即用方案

常规风险

凭证泄露:App Secret 与 X-Access-Key 若硬编码或日志打印,将导致数据泄露。合规盲区:未审阅隐私政策即上传含客户 PII 的发票,可能违反 GDPR/数据安全法。过度依赖置信度:高置信度≠100%准确,关键金额仍需抽样审计。异步任务 orphaned:未实现 task_id 持久化,网络中断可能导致任务结果丢失。

技能正文


name: laiye-doc-processing description: 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. License: Commercial license required. New users receive 100 free credits monthly to offset usage.

Laiye Agentic Document Processing (ADP)

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=clawhub

Quick Start

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]
    }
  ]
}

Setup

1. Get Your API Credentials

# 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"

2. Configuration (Optional)

Recommended: Use environment variables (most secure):

{
  skills: {
    entries: {
      "adp-doc-extraction": {
        enabled: true,
        // API credentials loaded from environment variables
      },
    },
  },
}

Security Note:

  • Set file permissions: chmod 600 ~/.openclaw/openclaw.json
  • Never commit this file to version control
  • Prefer environment variables or secret stores
  • Rotate credentials regularly

Common Tasks

Extract from File URL

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"
  }'

Extract from Base64

# 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\"
  }"

Extract with VLM Results

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"]

Async Extraction (Large Documents)

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"

Advanced Features

Custom Scale Parameter

Enhance VLM quality with higher resolution:

# model_params: { "scale": 2.0 }

Specify Config Version

Use a specific extraction configuration:

# model_params: { "version_id": "config_version_id" }

Document Recognition Only

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"
  }'

When to Use

Use ADP For:

  • Invoice processing
  • Order processing
  • Receipt processing
  • Financial document processing
  • Logistics document processing
  • Multi-table document data extraction

Don't Use For:

  • Video transcription
  • audio transcription

Best Practices

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:

  • Range: 0-1 per field
  • Review fields with confidence <0.8 manually

Response Structure:

  • extraction_result: Array of extracted fields
  • doc_recognize_result: VLM results (when with_rec_result=true)
  • metadata: Processing info (pages, time, model)

Response Schema

Success Response

{
  "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"
  }
}

Error Response

{
  "detail": "Error message description"
}

Common Use Cases

Invoice/Receipt Extraction

Extracts: invoice_number, invoice_date, vendor/customer_name, currency, vat_rate, total_amount_including_tax, total_amount_excluding_tax, line_items, etc.

Purchase Order Extraction

Extracts: order_number, order_date, buyer_name/seller_name, address, total_amount, line_items, etc.

Security & Privacy

Data Handling

Important: Documents uploaded to ADP are transmitted to https://adp-global.laiye.com/?utm_source=clawhub and processed on external servers.

Before uploading sensitive documents:

  • Review ADP privacy policy and data retention policies
  • Verify encryption in transit (HTTPS) and at rest
  • Confirm data deletion/retention timelines
  • Test with non-sensitive sample documents first

Best practices:

  • Do not upload highly sensitive PII until you've confirmed security posture
  • Use credentials with limited permissions if available
  • Rotate credentials regularly (every 90 days recommended)
  • Monitor API usage logs for unauthorized access
  • Never log or commit credentials to repositories

File Size Limits

  • Max file size: 50MB
  • Supported formats: .jpeg, .jpg, .png, .bmp, .tiff, .pdf, .doc, .docx, .xls, .xlsx
  • Concurrency limit: Free users support 1 concurrent request, paid users support 2 concurrent requests
  • Timeout: 10 minutes for sync requests

Operational Safeguards

  • Always use environment variables or secure secret stores for credentials
  • Never include real credentials in code examples or documentation
  • Use placeholder values like "your_access_key_here" in examples
  • Set appropriate file permissions on configuration files (600)
  • Enable credential rotation and monitor usage

Billing

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.

Troubleshooting

Error Code Description Common Causes & Solutions
400 Bad Request Invalid request parameters • Missing app_key or app_secret• Must provide exactly one input: file_url or file_base64• Application has no published extraction config
401 Unauthorized Authentication failed • Invalid X-Access-Key• Incorrect timestamp format (use Unix timestamp)• Invalid signature format (must be UUID)
404 Not Found Resource not found • Application does not exist• No published extraction config found for the application
500 Internal Server Error Server-side processing error • Document conversion failed• VLM recognition timeout• LLM extraction failure
Sync Timeout Request processing timed out • Large files should use async endpoint• Poll /query/task/{task_id} for results

Pre-Publish Security Checklist

Before publishing or updating this skill, verify:

  • package.json declares requiredEnv and primaryEnv for credentials
  • package.json lists API endpoints in endpoints array
  • All code examples use placeholder values not real credentials
  • No credentials or secrets are embedded in SKILL.md or package.json
  • Security & Privacy section documents data handling and risks
  • Configuration examples include security warnings for plaintext storage
  • File permission guidance is included for config files

References

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

ocrdocument-processinginvoice-extractionapi-integrationenterprise-automationvlmllmfinancial-documents

同类 Skill