工具箱开放 API(自动化中枢)

50+ 工具引擎变成 REST 接口:X-API-Key 鉴权,每把 Key 可限定工具 / IP / 频次配额,脚本与 CI 即插即用。

X-API-Key 鉴权与 Key 管理

API 网关不走 Web 登录态:请求只需携带 X-API-Key 头。Key 以哈希存储、恒定时间比对;连续鉴权失败的来源 IP 会被自动临时封禁,防暴力枚举。

Bashcurl -X POST -H "X-API-Key: bn_xxxxxxxx" \ -F "file=@report.pdf" \ https://你的域名/api/v1/tools/pdf/compress

每把 Key 独立管控

创建 Key 时按能力范围勾选开放的工具(支持通配符),并可叠加来源 IP 白名单、每分钟请求数(默认 60,可调)与每日调用配额;任务与结果按 Key 归属隔离,朋友或同事持 Key 即可调用,无需开设账号。

  • 仅创始账号可创建 / 管理 Key(敏感凭证责任到人)
  • 每把 Key 独立查看调用统计与日志
  • 可随时禁用、设置过期时间或删除

全量工具端点

网关与界面工具箱共用同一引擎:PDF 14 个端点、图片 14 个、文本 4 个、开发者 12 个、OCR 2 个、文档转换 2 个、AI 图像 4 个;AI 系列为异步任务,配套任务状态查询、SSE 进度流、取消、删除、下载与任务列表接口。

文档与接入

系统自带对外文档页与完整可运行实例页(可把地址直接分享给同事),并支持单文件示例下载;CORS 跨域来源可配置,便于网页端脚本直接调用。

网关未开启时相关页面统一返回维护提示;灰度开放由管理员在工具箱设置中按能力范围控制。

X-API-Key Auth & Key Management

The gateway bypasses web sessions: requests only carry an X-API-Key header. Keys are stored as hashes with constant-time comparison; source IPs with repeated failures are temporarily banned against brute force.

Bashcurl -X POST -H "X-API-Key: bn_xxxxxxxx" \ -F "file=@report.pdf" \ https://your-domain/api/v1/tools/pdf/compress

Per-key Control

When creating a key, scope the allowed tools (wildcards supported), then layer source-IP allowlists, requests-per-minute (default 60, tunable) and a daily quota; tasks and results are isolated per key. Friends or colleagues can call with a key — no accounts needed.

  • Only the founder account can create / manage keys
  • Per-key call statistics and logs
  • Disable, set expiry or delete anytime

Full Endpoint Matrix

The gateway shares the exact engines of the UI toolbox: 14 PDF endpoints, 14 image, 4 text, 12 dev, 2 OCR, 2 conversion and 4 AI imaging; the AI series runs async with task status, SSE progress stream, cancel, delete, download and listing.

Docs & Onboarding

Built-in public docs page and a runnable examples page (share the URL directly with teammates), plus single-file example download; CORS origins are configurable for browser-side scripts.

While the gateway is off, these pages return a maintenance notice; rollout is controlled by the admin per capability scope.