← 返回 Skills 市场
mag3nt

Mag3nt Pay

作者 mag3nt.com · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
41
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install mag3nt-pay
功能描述
Pay for any API that returns HTTP 402 Payment Required using Mag3nt virtual cards. Use when the agent encounters an HTTP 402 response, a paywall, a payment c...
使用说明 (SKILL.md)

Mag3nt Pay

Pay for any API that returns HTTP 402 using Mag3nt virtual cards and USDC. Supports Base, Solana and most EVMs. Settles on Solana, Base and Tempo.

Preflight

Confirm credentials are set:

[[ -z "$MAG3NT_API_KEY" ]] && echo "ERROR: Set MAG3NT_API_KEY (starts with mag3nt_live_)" && exit 1
[[ -z "$MAG3NT_CARD_ID" ]] && echo "ERROR: Set MAG3NT_CARD_ID" && exit 1
[[ -z "$MAG3NT_CARD_TOKEN" ]] && echo "ERROR: Set MAG3NT_CARD_TOKEN" && exit 1

If credentials are missing, tell the user to visit mag3nt.com to create an account, generate an API key, and fund an agent card.

When to Activate

Activate this skill when ANY of these occur:

  1. An HTTP response has status code 402
  2. A response contains a PAYMENT-REQUIRED header
  3. A response contains a WWW-Authenticate header with Payment request=
  4. A response contains an AP2-Challenge header
  5. A response body contains a paylink object with a code field
  6. The user asks to "pay for", "buy access to", or "unlock" an API
  7. The user asks to check their Mag3nt balance or card status

How Payment Works

Mag3nt has one universal payment endpoint: POST https://mag3nt.com/api/pay

For x402, MPP, and AP2 protocols, you do NOT need to detect or decode the protocol yourself. Just pass the target URL and the engine auto-detects the protocol and settles on-chain.

For Pay Links (paylink object in 402 body), use POST https://mag3nt.com/api/pay/{code}/settle with card credentials. No API key required.

Protocol Detection and Routing

When you receive an HTTP 402, inspect the response in this order:

  1. Body contains paylink object → Pay Link → read references/paylink-pay.md
  2. Any protocol header (PAYMENT-REQUIRED, WWW-Authenticate, AP2-Challenge) → use the universal pay endpoint → read references/x402-pay.md

Always check balance first. Read references/balance.md before any payment.

Reference Routing

Task Read This First
Set up credentials references/setup.md
Check card balance references/balance.md
Pay a Pay Link (most common, no API key needed) references/paylink-pay.md
Pay any x402 / MPP / AP2 protected API references/x402-pay.md
MPP-specific detection notes references/mpp-pay.md
AP2-specific detection notes references/ap2-pay.md

Payment Flow

  1. Detect — Agent receives HTTP 402
  2. Check — Verify card balance >= required amount via GET /api/cards
  3. Pay — Call POST /api/pay with { card_id, card_token, url } (or POST /api/pay/{code}/settle for Pay Links)
  4. Retry — Re-send the original request with the payment receipt header

Error Handling

  • Insufficient balance (403): Tell the user the current balance and required amount. Suggest topping up at mag3nt.com.
  • Card frozen or inactive: Tell the user to check their card status in the dashboard.
  • Already settled (410): The payment was already made. Proceed directly to retrying the request.
  • No payable option (422): The target URL does not offer any payment protocol. Tell the user.
  • Network mismatch: Ensure the card's network matches what the merchant expects. The network is set when the card is created.

Important

  • All payments are in USDC on the network configured for the card
  • Card credentials never leave the local environment
  • The agent should always confirm the payment amount with the user before paying amounts > $1.00
  • Pay Links are the most common protocol — most merchants use them
  • API base URL is https://mag3nt.com (not api.mag3nt.com)
安全使用建议
Install only if you are comfortable giving the agent access to a funded Mag3nt card. Use a low-limit card, rotate tokens, avoid forwarding sensitive request headers or bodies, and require manual approval for every payment regardless of amount until the skill documents stronger merchant validation, spend limits, and credential handling.
能力标签
cryptofinancial-authorityrequires-walletcan-make-purchasescan-sign-transactionsrequires-paid-servicerequires-sensitive-credentials
能力评估
Purpose & Capability
The purpose is coherent: paying HTTP 402 API charges using Mag3nt cards. The concern is proportionality: it instructs agents to pay automatically for amounts up to $1.00 and supports recurring, metered, and on-chain settlement flows without clear per-payment approval, merchant validation, or session spend caps.
Instruction Scope
Activation is broad for any HTTP 402, payment header, or paylink object. The artifacts require balance checks and user confirmation only above $1.00, leaving smaller charges and retries agent-directed rather than clearly user-approved.
Install Mechanism
No install-time persistence, package dependency, or hidden setup behavior was found. The allowed tools include node, npm, npx, and curl, which are broad but consistent with API examples and the quickstart script.
Credentials
The skill requires Mag3nt API keys and card tokens and sends them to Mag3nt payment endpoints. That is purpose-aligned for a payment skill, but the documentation also says card credentials never leave the local environment, which conflicts with the provided API examples.
Persistence & Privilege
No background persistence or privilege escalation is present, but the skill grants high-impact financial authority through reusable environment credentials and card tokens without strong scoping, allowlisting, or revocation guidance.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install mag3nt-pay
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /mag3nt-pay 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
fix: correct chain support (Base, Solana, most EVMs), add Python SDK
v1.0.0
Initial release of mag3nt-pay skill: - Enables API payments using Mag3nt virtual cards when encountering HTTP 402, payment headers, paylinks, or payment challenges. - Supports x402, MPP, AP2, and Pay Link protocols with auto-detection and universal settlement flow. - Guides through credential setup, card balance checks, and protocol-specific payment processing. - Handles error cases including insufficient balance, card issues, and network mismatches. - Ensures security of card credentials and prompts for user confirmation on payments over $1.00 USDC.
元数据
Slug mag3nt-pay
版本 1.0.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 2
常见问题

Mag3nt Pay 是什么?

Pay for any API that returns HTTP 402 Payment Required using Mag3nt virtual cards. Use when the agent encounters an HTTP 402 response, a paywall, a payment c... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 41 次。

如何安装 Mag3nt Pay?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install mag3nt-pay」即可一键安装,无需额外配置。

Mag3nt Pay 是免费的吗?

是的,Mag3nt Pay 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Mag3nt Pay 支持哪些平台?

Mag3nt Pay 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Mag3nt Pay?

由 mag3nt.com(@mag3nt)开发并维护,当前版本 v1.0.1。

💬 留言讨论