← 返回 Skills 市场
264
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install invoice-discern
功能描述
使用慧穗云发票识别 API,通过上传发票影像文件(图片、PDF、OFD、ZIP)自动识别发票信息。
使用说明 (SKILL.md)
发票识别-慧穗云(Invoice Discern)
基于慧穗云官方 API 的发票识别技能,支持通过上传发票影像文件自动识别发票信息,包括增值税发票、机动车发票、火车票、飞机票等多种票据类型。
环境变量配置
# Linux / macOS
export HSY_API_URL="https://huisuiyun.com"
export HSY_AK="your_ak_here"
export HSY_SK="your_sk_here"
export HSY_TYPE="2" # 1: ISV等级AKSK, 2: 慧穗云等级AKSK
# Windows PowerShell
$env:HSY_API_URL="https://huisuiyun.com"
$env:HSY_AK="your_ak_here"
$env:HSY_SK="your_sk_here"
$env:HSY_TYPE="2"
获取 AK/SK:
- 慧穗云秘钥管理:https://huisuiyun.com/account/conf/secretkey
注意: 如果未配置环境变量,脚本会返回包含配置链接的错误信息,方便用户快速获取秘钥。
脚本路径
脚本文件:skills/invoice-discern/invoice-discern.py
使用方式
1. 识别发票信息
通过 /api/v2/agent/cdk/invoice/discern 接口识别发票影像文件
python3 skills/invoice-discern/invoice-discern.py discern /path/to/invoice.jpg
支持的文件格式
- 图片格式:.jpg, .jpeg, .png(一张图片最多包含9张发票)
- PDF格式:.pdf(每页只能有一张发票,最多30页)
- OFD格式:.ofd
- 压缩包:.zip(多张发票存放在一个文件夹内压缩,不允许二级目录)
- 文件大小:不超过 6M
支持的票种类型
| 票种名称 | 票种代码 |
|---|---|
| 增值税专用发票 | 01 |
| 机动车销售统一发票 | 03 |
| 增值税普通发票 | 04 |
| 增值税专用电子发票 | 08 |
| 增值税电子普通发票 | 10 |
| 增值税普通发票(卷票) | 11 |
| 通行费增值税电子普通发票 | 14 |
| 二手车销售统一发票 | 15 |
| 全电发票(普通发票) | 90 |
| 全电发票(增值税专用发票) | 09 |
| 全电纸质发票(增值税专用发票) | 85 |
| 全电纸票发票(普通发票) | 86 |
| 全电发票(铁路电子客票) | 51 |
| 全电发票(航空运输电子客票行程单) | 61 |
| 机打发票 | 199 |
| 定额发票 | 200 |
| 火车票 | 201 |
| 航空运输电子客票行程单 | 202 |
| 客运汽车 | 203 |
| 过路费 | 205 |
| 船票 | 204 |
| 出租车发票 | 207 |
| 电子医疗票据 | 209 |
| 滴滴出行行程单 | 210 |
| 非税收入类票据 | 211 |
返回结果示例
{
"code": "200",
"message": "OK",
"serialNo": "635436126077288448",
"data": {
"invoiceList": [
{
"invoiceType": "01",
"invoiceCode": "3100212130",
"invoiceNo": "37243570",
"drewDate": "2021-10-27",
"amount": 2990.25,
"amountWithTax": 3378.98,
"taxAmount": 388.73,
"purchaserName": "慧穗数字科技****",
"purchaserTaxNo": "9131011****",
"sellerName": "上海京东鸿为****",
"sellerTaxNo": "91310107M****",
"filePath": "http://...",
"items": [
{
"goodsName": "*电子计算机*笔记本电脑",
"amount": "3538.94",
"taxRate": "13%",
"taxAmount": "460.06"
}
]
}
],
"nonVatInvoiceList": [
{
"invoiceType": "201",
"invoiceNo": "Z106J018400",
"drewDate": "2019-11-18",
"amountWithTax": "73.00",
"stationGetOn": "杭州东",
"stationGetOff": "上海虹桥",
"passengerName": "张三",
"trainNumber": "G7510"
}
]
}
}
返回参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | String | 返回状态码:200-成功 |
| serialNo | String | 返回流水号 |
| message | String | 返回信息 |
| data | Object | 识别的发票信息集合 |
| data.invoiceList | Array | 增值税发票信息列表 |
| data.nonVatInvoiceList | Array | 非增值税发票信息列表 |
增值税发票字段(invoiceList)
| 字段名 | 类型 | 说明 |
|---|---|---|
| invoiceType | String | 发票类型(见票种码值表) |
| invoiceCode | String | 发票代码(全电发票为空) |
| invoiceNo | String | 发票号码 |
| drewDate | String | 开票日期 |
| amount | BigDecimal | 不含税金额 |
| amountWithTax | BigDecimal | 含税金额 |
| taxAmount | BigDecimal | 税额 |
| purchaserName | String | 购方名称 |
| purchaserTaxNo | String | 购方税号 |
| sellerName | String | 销方名称 |
| sellerTaxNo | String | 销方税号 |
| filePath | String | 文件下载地址 |
| items | Array | 商品明细列表 |
常见错误码
| 错误码 | 说明 |
|---|---|
| 200 | 识别成功 |
| 501 | 连接超时,请稍后重试 |
| 其他 | 详见接口返回的 message |
注意事项
- 支持的文件格式:.jpg, .jpeg, .png, .pdf, .ofd, .zip
- 文件大小不超过 6M
- 图片格式一张图片最多包含 9 张发票
- PDF 文件每页只能有一张发票,最多 30 页
- ZIP 文件不允许存在二级目录
- 全电多明细 PDF 会分别返回每页发票信息
- Token 有效期为 30 天,超出有效期后需重新获取
在 OpenClaw 中的推荐用法
- 用户提供发票影像文件路径
- 代理调用:
python3 skills/invoice-discern/invoice-discern.py discern \x3Cfile_path> - 从返回结果中读取识别的发票信息
- 向用户总结发票的关键信息(发票类型、金额、购销方等)
如需了解更多欢迎扫码联系

安全使用建议
This skill appears to do what it says: it uploads a user-provided invoice image/PDF/ZIP to Huisuiyun and returns the recognition results. Before installing, consider: 1) You must provide HSY_AK and HSY_SK (these are service API keys) — only give keys you trust this service with. 2) The skill will send invoice images (which may contain sensitive personal or financial data) to the external Huisuiyun API endpoint; ensure you are comfortable with that data flow and the vendor's privacy policy. 3) The Python script uses the 'requests' library but the skill doesn't install dependencies automatically—make sure the runtime has requests available. 4) Minor documentation mismatch: SKILL.md references HSY_API_URL and HSY_TYPE (optional) though only HSY_AK/HSY_SK are marked required; expect to set HSY_API_URL only if you need a non-default host. If you trust the vendor and the data flow, the skill is coherent and reasonable to use.
功能分析
Type: OpenClaw Skill
Name: invoice-discern
Version: 1.0.1
The skill bundle is a legitimate integration for the Huisuiyun (慧穗云) invoice recognition API. The Python script `invoice-discern.py` correctly handles authentication using API keys (AK/SK) from environment variables and securely uploads invoice files to the official service endpoint (huisuiyun.com). No evidence of data exfiltration, malicious execution, or prompt injection was found; the code logic strictly follows the documented purpose.
能力评估
Purpose & Capability
Name/description, required binaries (python3), required env vars (HSY_AK, HSY_SK), and the script all align with an invoice-recognition client for the Huisuiyun API. The API host used (huisuiyun.com) matches the description.
Instruction Scope
The SKILL.md and script only instruct the agent to read the user-supplied invoice file and environment variables and call Huisuiyun endpoints. They do not attempt to read other system files or unrelated credentials. Minor note: the runtime uses HSY_API_URL and HSY_TYPE (and provides defaults) but those are not listed as required env vars in the top-level metadata—this is a scope/documentation mismatch but not a functional surprise.
Install Mechanism
There is no install spec (instruction-only) which reduces risk. One practical omission: the Python script depends on the 'requests' package but the skill metadata only declares python3; there is no instruction to install requests. This is an operational/dependency gap rather than a security concern.
Credentials
The skill asks only for HSY_AK and HSY_SK as required credentials, which is proportionate for calling the vendor API. The script also reads optional HSY_API_URL and HSY_TYPE (used to choose auth behavior); these are reasonable for configuring which API endpoint/type to use.
Persistence & Privilege
always is false, no install modifies other skills or system-wide settings, and the skill does not request persistent/system privileges. It operates only when invoked.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install invoice-discern - 安装完成后,直接呼叫该 Skill 的名称或使用
/invoice-discern触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- 修正了脚本路径,统一为 skills/invoice-discern/invoice-discern.py
- 所有使用方式中的调用路径已同步更新
- 其余内容保持不变
v1.0.0
Initial release with HuiSuiYun invoice recognition API integration.
- Supports automatic extraction of invoice information from image, PDF, OFD, or ZIP files.
- Recognizes various invoice types (VAT, vehicle, train ticket, flight itinerary, etc.).
- Returns structured details, including amount, purchaser/seller info, and line items.
- Requires configuration of HSY_AK and HSY_SK environment variables.
- Provides detailed error messages and user guidance if configuration is missing.
元数据
常见问题
发票识别(invoice-discern) - 慧穗云 是什么?
使用慧穗云发票识别 API,通过上传发票影像文件(图片、PDF、OFD、ZIP)自动识别发票信息。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 264 次。
如何安装 发票识别(invoice-discern) - 慧穗云?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install invoice-discern」即可一键安装,无需额外配置。
发票识别(invoice-discern) - 慧穗云 是免费的吗?
是的,发票识别(invoice-discern) - 慧穗云 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
发票识别(invoice-discern) - 慧穗云 支持哪些平台?
发票识别(invoice-discern) - 慧穗云 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 发票识别(invoice-discern) - 慧穗云?
由 小毅尔勒(@xiaoyierle)开发并维护,当前版本 v1.0.1。
推荐 Skills