← Back to Skills Marketplace
scnet-sugon

Expense Invoice Ocr

by SCNet-sugon · GitHub ↗ · v1.0.5 · MIT-0
cross-platform ✓ Security Clean
311
Downloads
0
Stars
1
Active Installs
5
Versions
Install in OpenClaw
/install expense-invoice-ocr
Description
支持识别企业财务报销场景的常见票据,包括增值税发票、增值税卷票、出租车发票、火车票、航空电子客票行程单、机动车销售统一发票、定额发票、过路过桥费发票、医疗发票、税收完税证明、船票、非税票据、通用机打发票、汽车票识别。
README (SKILL.md)

\r

Sugon-Scnet 通用 OCR 技能\r

\r 本技能封装了 Sugon-Scnet 企业财务报销 OCR 服务,通过单一接口即可调用 14 种识别能力,高效提取文字及票据信息。\r \r

功能特性\r

\r

  • 财务票据:覆盖增值税发票、增值税卷票、出租车发票、火车票、航空电子客票行程单、机动车销售统一发票、定额发票、过路过桥费发票、医疗发票、税收完税证明、船票、非税票据、通用机打发票、汽车票识别,自动提取关键字段。\r \r

前置配置\r

\r

⚠️ 重要:使用前需要申请 Scnet API Token\r \r

申请 API Token\r

\r

  1. 访问 Scnet 官网 注册/登录\r
  2. 在控制台申请 API 密钥(格式:sc-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)\r
  3. 复制密钥备用\r \r

配置 Token\r

\r 手动配置(推荐)\r

  1. 在技能目录下创建 config/.env 文件,内容如下:\r
# =====  Sugon-Scnet OCR API 配置 =====\r
# 申请地址:https://www.scnet.cn\r
SCNET_API_KEY=your_scnet_api_key_here\r
\r
# API 基础地址(一般无需修改)\r
SCNET_API_BASE=https://api.scnet.cn/api/llm/v1\r
```\r
2. 添加:`SCNET_API_KEY=你的密钥`\r
3. 设置文件权限为 600(仅所有者可读写)\r
**⚠️ 安全警告**:切勿将 API Key 直接粘贴到聊天对话中,否则可能被记录或泄露。\r
\r
### Token 更新\r
\r
Token 过期后调用会返回 401 或 403 错误。更新方法:重新申请 Token 并替换 config/.env 中的 SCNET_API_KEY。\r
\r
### 依赖安装\r
\r
本技能需要 Python 3.6+ 和 requests 库。请运行以下命令:\r
\r
```bash\r
   pip install requests\r
```\r
---\r
### 使用方法\r
\r
### 参数说明\r
\r
| 参数名 | 类型 | 必填 | 描述 |\r
|--------|------|------|------|\r
| ocrType | string | 是 | 识别类型枚举。必须为以下之一:\x3Cbr>• VAT_INVOICE(增值税发票)\x3Cbr>• VAT_ROLL_INVOICE(增值税卷票)\x3Cbr>• TAXI_INVOICE(出租车发票)\x3Cbr>• TRAIN_TICKET(火车票)\x3Cbr>• AIRPORT_TICKET(航空运输电子客票行程单)\x3Cbr>• VEHICLE_SALE_INVOICE(机动车销售统一发票)\x3Cbr>• QUOTA_INVOICE(定额发票)\x3Cbr>• TOLL_INVOICE(过路过桥费发票)\x3Cbr>• MEDICAL_INVOICE(医疗发票)\x3Cbr>• TAX_CERTIFICATE(税收完税证明)\x3Cbr>• NON_TAX_BILL(非税票据)\x3Cbr>• GENERAL_MACHINE_INVOICE(通用机打发票)\x3Cbr>• SHIP_TICKET(船票)\x3Cbr>• BUS_TICKET(汽车票) |\r
| filePath | string | 是 | 待识别图片的本地绝对路径。支持 jpg、png、pdf 等常见格式。 |\r
\r
### 命令行调用示例\r
\r
```bash\r
   python .claude/skills/expense_invoice_ocr/scripts/main.py VAT_INVOICE /path/to/invoice.jpg\r
```\r
\r
### 在 AI 对话中使用\r
\r
用户可以说:\r
\r
- “提取这张发票的信息,路径是 /Users/name/Downloads/fapiao.png”\r
\r
AI 会根据 description 中的关键词自动触发本技能。\r
\r
### AI 调用建议\r
为避免触发 API 速率限制(10 QPS),请串行调用本技能,即等待前一个识别完成后再发起下一个请求。\r
如果使用 OpenClaw 的 exec 工具,建议设置 timeout 或 yieldMs 参数,让命令同步执行,避免多个命令同时运行导致并发。\r
\r
### 配置选项\r
\r
编辑 `config/.env` 文件:\r
\r
| 变量名 | 默认值 | 说明 |\r
|--------|--------|------|\r
| SCNET_API_KEY | 必需 | Scnet API 密钥 |\r
| SCNET_API_BASE | https://api.scnet.cn/api/llm/v1 | API 基础地址(一般无需修改) |\r
\r
### 输出\r
\r
- 标准输出:识别结果的 JSON 数据,结构与 API 文档一致,位于 `data` 字段内。\r
- 识别结果位于 data[0].result[0].elements 中,具体字段取决于 ocrType。\r
- 错误信息:如果发生错误,会输出以 `错误:` 开头的友好提示。\r
\r
### 注意事项\r
\r
- 本技能调用的 OCR API 有 10 QPS 的速率限制。\r
- 如果遇到 429 错误,请等待 2-3 秒后重试,不要连续发起请求。\r
- 建议在调用前确保图片已准备就绪,避免因网络问题导致重复调用。\r
\r
### 故障排除\r
\r
| 问题 | 解决方案 |\r
|------|----------|\r
| 配置文件不存在 | 创建 config/.env 并填入 Token(参考前置配置) |\r
| API Key 无效/过期 | 重新申请 Token 并更新 `.env` 文件 |\r
| 文件不存在 | 检查提供的文件路径是否正确 |\r
| 网络连接失败 | 检查网络连接或防火墙设置 |\r
| 不支持的文件类型 | 确保文件扩展名为允许的类型(参考 API 文档) |\r
| 401/403/Unauthorized | Token 无效或过期,重新申请并配置 |\r
| 429 Too Many Requests | 请求过于频繁,技能会自动等待并重试(最多 3 次)。若持续失败,请降低调用频率或联系服务方提高限额。 |\r
\r
Usage Guidance
This skill appears to be what it says: a connector to Sugon-Scnet OCR. Before installing: (1) Confirm you trust the Scnet service and the domain api.scnet.cn; (2) Obtain an API key from Scnet and store it securely (prefer environment variables or a config file with restrictive permissions as instructed), and never paste it into chat; (3) Review privacy implications — image uploads go to Scnet’s servers, so avoid sending highly sensitive documents until you confirm the provider's retention and handling policies; (4) Note the script removes per-item 'confidence' fields before printing results (not a security issue but may affect downstream validation); (5) README contains a placeholder/internal URL and skill.yaml points to a GitHub repo placeholder — you may want to verify upstream source if provenance matters.
Capability Analysis
Type: OpenClaw Skill Name: expense-invoice-ocr Version: 1.0.5 The skill is a legitimate OCR tool for processing financial invoices via the Sugon-Scnet API (api.scnet.cn). The implementation in scripts/main.py is well-structured, featuring robust error handling, exponential backoff for rate limiting, and data sanitization (removing confidence scores). SKILL.md includes proactive security warnings advising users not to share API keys in chat, and the code lacks any indicators of malicious intent, unauthorized data access, or command injection.
Capability Tags
cryptocan-make-purchasesrequires-sensitive-credentials
Capability Assessment
Purpose & Capability
The skill is an OCR/invoice extraction integration. The only required credential is SCNET_API_KEY and the script posts files to https://api.scnet.cn/api/llm/v1/ocr/recognize, which matches the described purpose.
Instruction Scope
SKILL.md and scripts/main.py limit operations to reading a specified local file, loading a local config/.env (or env var), and uploading the file to the Scnet OCR endpoint. There are no instructions to read unrelated system files, other credentials, or to exfiltrate data to unexpected endpoints.
Install Mechanism
This is an instruction-only skill with one small Python script and no install spec. It only asks users to have Python 3 and install the requests library (pip install requests), which is proportionate to the task.
Credentials
Only SCNET_API_KEY (and optional SCNET_API_BASE) are declared/used. No unrelated secrets or many environment variables are requested; access is proportional to an external OCR API integration.
Persistence & Privilege
The skill does not request permanent/always-on inclusion, does not modify other skills or system-wide settings, and performs only normal runtime actions. It reads a local config file only within its own directory.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install expense-invoice-ocr
  3. After installation, invoke the skill by name or use /expense-invoice-ocr
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.5
- No functional changes; version bump only. - No file or documentation changes detected for this release.
v1.0.4
- Added skill.yaml for standard skill metadata. - Updated SKILL.md: now explicitly lists required environment variables and dependencies. - Improved configuration instructions, highlighting security best practices for API keys. - Added a dependencies section specifying Python 3 and requests. - Clarified manual configuration steps and removed AI auto-configuration prompts. - Minor refinements to usage and troubleshooting documentation for clarity.
v1.0.2
expense-invoice-ocr 1.0.2 - No file changes detected compared to previous version. - No updates to features, documentation, or configuration. - Version bump only; functionality remains the same as 1.0.0.
v1.0.1
- 移除了 config.json 配置文件,简化配置方式。 - 扩展并细化了技能文档,介绍了更多票据识别种类和能力。 - 新增 QPS 速率限制提示与并发调用建议,提升使用安全性。 - 明确列出所有支持的 ocrType 类型和对应发票场景。 - 文档中补充了 429 限流错误和自动重试说明。 - 部分表述聚焦于企业财务发票场景,优化了说明内容。
v0.1.0
Version 0.1.0 - Initial release of the expense_invoice_ocr skill. - Supports OCR recognition for common financial reimbursement documents in China, including VAT invoices, taxi receipts, train tickets, electronic tickets, and more. - Requires a Scnet API Token for use, with detailed setup instructions provided. - Accepts configurable recognition type and local file path as inputs. - Outputs structured JSON containing recognition results and confidence scores, with error handling and troubleshooting guidance included.
Metadata
Slug expense-invoice-ocr
Version 1.0.5
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 5
Frequently Asked Questions

What is Expense Invoice Ocr?

支持识别企业财务报销场景的常见票据,包括增值税发票、增值税卷票、出租车发票、火车票、航空电子客票行程单、机动车销售统一发票、定额发票、过路过桥费发票、医疗发票、税收完税证明、船票、非税票据、通用机打发票、汽车票识别。 It is an AI Agent Skill for Claude Code / OpenClaw, with 311 downloads so far.

How do I install Expense Invoice Ocr?

Run "/install expense-invoice-ocr" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Expense Invoice Ocr free?

Yes, Expense Invoice Ocr is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Expense Invoice Ocr support?

Expense Invoice Ocr is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Expense Invoice Ocr?

It is built and maintained by SCNet-sugon (@scnet-sugon); the current version is v1.0.5.

💬 Comments