← 返回 Skills 市场
Metered API Marketplace
作者
Andrew Shingleton
· GitHub ↗
· v0.1.3
382
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install metered-api-marketplace
功能描述
Build and operate a metered public API endpoint ("agent microservice") for OpenClaw skills/agents with API-key auth, per-request usage logging + pricing, pre...
安全使用建议
This package appears to be a coherent metered-API reference implementation, but pay attention before installing or deploying:
- Metadata mismatch: the registry lists no required env vars, but the code requires a Postgres DATABASE_URL and several secrets (ADMIN_TOKEN, webhook secrets, fee addresses). Treat DATABASE_URL and webhook secrets as high-sensitivity credentials — granting them equals giving the service access to your database and to credit balances.
- Do not deploy with default/empty secrets. Set a strong ADMIN_TOKEN and unique WEBHOOK_SHARED_SECRET / provider webhook secrets before exposing admin endpoints.
- Admin endpoints (create-key, stats) exist — ensure these are protected by ADMIN_TOKEN and not public. If you deploy to a public host, restrict access (IP allowlist, additional auth) or remove admin routes from the public surface.
- The service requires a Postgres DB. Run it in an isolated project/account and avoid reusing a production database or credentials.
- Verify webhook handling and fee addresses. The server only accounts for bookkeeping; on-chain custody/splitting must be handled by your payment processor. Double-check fee calculations and where fee addresses are configured.
- Installation/Deployment: because there is no install spec, you (or your operator) will need to run npm install and manage deployment. Review package.json, pin dependency versions, and run dependency audits (npm audit / SCA) before deploying.
- Review the code yourself (or have an engineer review) for any environment-specific assumptions you may need to change (rate limits, pricing envs, MAX_BODY_BYTES). The transformer functions are deterministic and do not make outbound network calls, which reduces exfiltration risk, but the DB/webhook code will handle sensitive data.
If you want to proceed, require the publisher to update registry metadata to explicitly declare required env vars and permissions, or only run the reference implementation in an isolated/test environment until you are comfortable with configuration and security controls.
功能分析
Type: OpenClaw Skill
Name: metered-api-marketplace
Version: 0.1.3
The skill bundle implements a metered API marketplace with API key authentication, usage tracking, and payment webhooks. The code uses standard security practices such as HMAC-SHA256 for signature verification with timing-safe comparisons, and parameterized queries for all database interactions (PostgreSQL via `pg` library), effectively preventing SQL injection. The 'transformers' are pure functions, explicitly designed to be stateless and without I/O, which limits their attack surface. Sensitive configurations like `DATABASE_URL`, `ADMIN_TOKEN`, and various webhook secrets are expected to be provided via environment variables, which is a standard practice. While misconfiguration of these secrets could lead to vulnerabilities, the code itself does not exhibit any malicious intent, data exfiltration, unauthorized command execution, or prompt injection attempts in the `SKILL.md` or other documentation. All functionalities align with the stated purpose of building a monetized API service.
能力评估
Purpose & Capability
The name/description (metered public API with API-key auth, usage ledger, and payment webhooks) are consistent with the bundled server and Next.js reference code. However, the published metadata declares no required environment variables or credentials even though the code expects a Postgres DATABASE_URL, ADMIN_TOKEN, webhook secrets, fee addresses, and other env vars — a clear mismatch between stated registry requirements and actual runtime needs.
Instruction Scope
SKILL.md and the references document the expected workflow (pick transformer, run the server, create API keys, wire webhooks, deploy behind TLS). The runtime instructions and code operate within that advertised scope (authenticate signed API keys, check balances, deduct per-call cost, verify provider webhooks). The instructions do not direct the agent to read unrelated local system files or exfiltrate secrets, but they do require you to provide sensitive configuration (DB URL, webhook secrets, admin token).
Install Mechanism
There is no install spec in registry metadata (instruction-only), but the package contains runnable Node.js code (server and Next.js starter) that requires npm dependencies (next, pg, fastify, @fastify/rate-limit, etc.). This means the user/installer must run npm install / deploy themselves; nothing is downloaded from an untrusted URL, but the lack of an explicit install step in metadata is a usability/security gap (operators might not realize what will be required).
Credentials
Registry metadata lists no required env vars or credentials, yet the code and SKILL.md expect many sensitive env vars: DATABASE_URL (Postgres connection string), ADMIN_TOKEN, WEBHOOK_SHARED_SECRET, COINBASE_COMMERCE_WEBHOOK_SECRET, BTCPAY_WEBHOOK_SECRET, FEE_BPS, FEE_ETH_ADDRESS, FEE_BTC_ADDRESS, COST_CENTS_PER_CALL, MAX_BODY_BYTES, MAX_SKEW_MS, PORT/HOST, etc. Requesting a DB connection string and multiple webhook secrets is proportional for a hosted payments/ledger service, but the omission from metadata is an incoherence and a potential safety/permission model problem (user may not be warned up-front).
Persistence & Privilege
The skill does not request always:true, does not claim to modify other skills, and does not embed persistent platform-level privileges. It implements its own runtime server and DB records (api_keys, balances, usage, credits) which is normal for the stated purpose. Be aware running this creates a long-lived external service with its own credentials and webhooks.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install metered-api-marketplace - 安装完成后,直接呼叫该 Skill 的名称或使用
/metered-api-marketplace触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.3
Add Coinbase Commerce + BTCPay webhook verification adapters (real top-ups), update Next.js starter env vars
v0.1.2
Vercel/Next.js starter with clean /v1 rewrites, added 12 conversion/math transformers, added admin stats endpoint, /bin/zsh.25 flat pricing
v0.1.1
Add Vercel/Next.js serverless starter + Supabase pooler guidance
v0.1.0
Postgres ledger, 12 deterministic transformers, /bin/zsh.25 flat pricing, agent integration prompt
元数据
常见问题
Metered API Marketplace 是什么?
Build and operate a metered public API endpoint ("agent microservice") for OpenClaw skills/agents with API-key auth, per-request usage logging + pricing, pre... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 382 次。
如何安装 Metered API Marketplace?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install metered-api-marketplace」即可一键安装,无需额外配置。
Metered API Marketplace 是免费的吗?
是的,Metered API Marketplace 完全免费(开源免费),可自由下载、安装和使用。
Metered API Marketplace 支持哪些平台?
Metered API Marketplace 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Metered API Marketplace?
由 Andrew Shingleton(@arshingleton)开发并维护,当前版本 v0.1.3。
推荐 Skills