← 返回
未分类 Key 中文

Mag3nt Pay

Pay for APIs and services, receive payments, and manage agent wallets using Mag3nt USDC virtual cards. Activate when the agent needs to pay for a resource, e...
使用 Mag3nt USDC 虚拟卡支付 API 和服务费用、收款以及管理代理钱包;当代理需要支付资源时激活…
mag3nt mag3nt 来源
未分类 clawhub v1.0.5 1 版本 100000 Key: 需要
★ 0
Stars
📥 99
下载
💾 1
安装
1
版本
#latest

概述

Mag3nt Pay

Pay for APIs and services, receive payments, and manage agent wallets using USDC virtual cards. Settles on Base (eip155:8453), Solana (solana:mainnet), and Tempo (eip155:4217). Assets: USDC on Base/Solana, USDC or pathUSD on 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 (x402)
  3. A response contains a WWW-Authenticate header with Payment request= (MPP)
  4. A response body contains a paylink object with a code field (Pay Link)
  5. The user asks to issue or verify an AP2 payment mandate
  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 supports two payment models:

402-based (x402, MPP): One universal endpoint POST https://mag3nt.com/api/pay. Pass the target URL and the engine auto-detects the protocol (x402 or MPP) and settles on-chain.

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

AP2 (Google Agentic Payment Protocol): A separate mandate-based flow — NOT a 402 challenge. Uses dedicated endpoints at /api/ap2/*. Read references/ap2-pay.md for the full flow.

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. PAYMENT-REQUIRED or X-Payment header → x402 → read references/x402-pay.md
  3. WWW-Authenticate: Payment header → MPP → read references/mpp-pay.md then references/x402-pay.md

Multiple payment methods: Some merchants offer multiple methods (e.g. methods: ["tempo", "stripe"] in body, or multiple Payment challenges in WWW-Authenticate). Parse the header to identify all offered methods. Select the method Mag3nt supports — tempo (chain 4217), eip155:8453 (Base), or solana:mainnet. Ignore methods like stripe or card that require fiat. If payment fails on a multi-method endpoint, check the error response's challenge object to verify which method the engine attempted. Read references/mpp-pay.md for details.

AP2 does NOT use HTTP 402. It is a mandate-based flow triggered by a merchant checkout. Read references/ap2-pay.md.

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

Reference Routing

TaskRead This First
----------------------
Set up credentialsreferences/setup.md
Check card balancereferences/balance.md
Pay a Pay Link (most common, no API key needed)references/paylink-pay.md
Pay any x402 / MPP protected API (402-based)references/x402-pay.md
MPP-specific detection notesreferences/mpp-pay.md
AP2 mandate-based payments (not 402)references/ap2-pay.md

Payment Flow

  1. Detect — Agent receives HTTP 402
  2. Buyer-Agent Preflight — Before any autonomous spend, extract and verify:
    • Price / cap unit — exact amount and currency from the 402 challenge
    • Accepted methods — which payment methods the merchant supports (read the body and headers)
    • Policy / version hash — if the merchant provides terms or a policy hash, log it
    • Revocation / dispute path — merchant contact or refund endpoint
    • Allow / caution / block — if the amount exceeds the user's stated limit, STOP and ask for confirmation
  3. Check — Verify card balance >= required amount via GET /api/cards
  4. Pay — Call POST /api/pay with { card_id, card_token, url } (or POST /api/pay/{code}/settle for Pay Links). The response includes a transaction_id, settlement.tx_hash, and a credential object as settlement evidence.
  5. Receipt — Log the transaction_id, amount_debited, protocol, and tx_hash for audit
  6. Fulfillment — The pay engine returns settlement evidence (credential, tx_hash, protocol). It does NOT fulfill the purchase for you. Fulfillment means claiming what you paid for. Every merchant may implement fulfillment differently. Read the merchant's original challenge or checkout flow to understand how they expect payment proof presented. The credential object from the pay response contains the settlement evidence formatted for the detected protocol — use it as a starting point, but adapt based on what the merchant specified.

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

  • Payments settle in USDC (Base, Solana) or USDC/pathUSD (Tempo) depending on the merchant's challenge
  • Card credentials never leave the local environment
  • The agent should always confirm the payment amount with the user before paying amounts > $1.00
  • Every payment returns a transaction_id and on-chain tx_hash — always log these as charge-evidence
  • Pay Links are the most common protocol — most merchants use them
  • API base URL is https://mag3nt.com (not api.mag3nt.com)

版本历史

共 1 个版本

  • v1.0.5 当前
    2026-06-09 19:00 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 865 📥 344,942
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,441 📥 328,499
ai-agent

Find Skills

root
帮助用户发现和安装智能体技能,当用户询问如「如何做X」、「找X的技能」、「有能做...的吗」等问题时
★ 1,518 📥 574,820