← Back to Skills Marketplace
mag3nt

Mag3nt Pay

by mag3nt.com · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
41
Downloads
0
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install mag3nt-pay
Description
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...
README (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)
Usage Guidance
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.
Capability Tags
cryptofinancial-authorityrequires-walletcan-make-purchasescan-sign-transactionsrequires-paid-servicerequires-sensitive-credentials
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install mag3nt-pay
  3. After installation, invoke the skill by name or use /mag3nt-pay
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug mag3nt-pay
Version 1.0.1
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 41 downloads so far.

How do I install Mag3nt Pay?

Run "/install mag3nt-pay" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Mag3nt Pay free?

Yes, Mag3nt Pay is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Mag3nt Pay support?

Mag3nt Pay is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Mag3nt Pay?

It is built and maintained by mag3nt.com (@mag3nt); the current version is v1.0.1.

💬 Comments