MPP Agent Skill: Pay HTTP 402 APIs via Machine Payments Protocol
Pay HTTP 402 APIs via Machine Payments Protocol (MPP).
Written by Neura Market from the official Hermes Agent documentation for Mpp Agent. Commands, paths, and version numbers are reproduced from the source unchanged.
Read the official documentationMPP Client Wrapper Reference
Purpose
The MPP Client Wrapper lets Hermes pay HTTP 402 Payment Required responses from merchant APIs, enabling per-request API access through the MPP protocol. It wraps multiple MPP client tools so you can choose the one that matches your funded wallet or the merchant's challenge method.
When to Use
Use this tool when a merchant API returns an HTTP 402 response with a www-authenticate header and you want to pay it. Also use it when someone asks to "pay per request", "set up an agent wallet", "use Tempo / Privy / AgentCash", or wants to discover MPP-priced services. If Stripe Link spend produced a Shared Payment Token (SPT) and the agent needs to attach it to the 402 challenge, prefer link-cli mpp pay in that flow.
Capabilities
- Pay HTTP 402 Payment Required responses using the MPP protocol.
- Support multiple MPP client tools:
link-cli, Tempo Wallet, Privy Agent CLI, AgentCash, andmppx. - Automatically handle the 402 challenge/credential dance with
mppx. - Support non-GET methods and request bodies with
mppx. - Inspect a merchant's 402 challenge via
curl. - Verify receipt headers with
mppx -v. - Support zero-amount challenges (proof credential only).
Prerequisites
- Node.js 20+ on
PATH. - A funded wallet (Tempo/Privy/AgentCash) OR an
mppxaccount. - For Tempo/Privy/AgentCash: follow their respective onboarding skills (fetch their SKILL.md via
web_extract).
Procedures
mppx (Fastest Path)
- Install
mppxglobally and create an account:
npm install -g mppx
mppx account create
Store credentials as the CLI instructs; do not paste them into a transcript.
- Probe the URL with
curlto confirm the MPP 402 response:
curl -i <url>
Look for a response like:
HTTP/1.1 402 Payment Required
www-authenticate: tempo amount=0.1 currency=...
- Pay the request:
mppx <url>
- For non-GET methods or request bodies:
mppx <url> --method POST --data '<json>'
- Verify the receipt:
mppx <url> -v
Tempo Wallet
- Fetch the canonical skill from
https://tempo.xyz/SKILL.mdusingweb_extract. - Run:
tempo wallet login
tempo wallet pay <url>
Privy Agent CLI
- Fetch the skill from
https://agents.privy.io/skill.mdusingweb_extract. - Run
privy-agent-wallets loginand follow the prompts.
AgentCash
- Fetch the skill from
https://agentcash.dev/skill.mdusingweb_extract. - Run
npx agentcash onboardand follow the prompts.
Parameters
| Parameter | Meaning | Required |
|---|---|---|
url | The merchant API endpoint that returns HTTP 402. | Yes |
--method | HTTP method for the request (e.g., POST). | No (default GET) |
--data | JSON body for the request. | No |
-v | Verbose output to inspect receipt headers. | No |
Constraints and Caveats
- Gated
[linux, macos]while broader payments tooling matures on Windows. - If the 402 challenge has
method="stripe", preferlink-cli mpp payvia thestripe-link-cliskill. - If the 402 challenge lacks
method="stripe", Stripe Link cannot pay it; usemppxor a matching wallet. - Multiple challenges in the
www-authenticateheader:link-clipickstempo, stripe,mppxpicks tempo; choose by your funded wallet. - Zero-amount challenges (e.g.,
$0.00) work without a funded wallet; do not refuse them as broken. - Wallet keys never enter the agent context; do not
catorread_filethem. - Server-side MPP (adding
HTTP 402to your own API) is a different skill; point tompp.dev/quickstart/serverandmppxmiddlewares (mppx/nextjs,mppx/hono,mppx/express,mppx/elysia,mpp-server). - For Tempo/Privy/AgentCash, follow their respective onboarding skills (fetch SKILL.md via
web_extract). - Default client: if the user has Stripe Link or the challenge has
method="stripe", uselink-cli mpp pay; else usemppxfor one-off calls, Tempo Wallet for persistent spend controls.
Failure Modes
HTTP 402withoutmethod="stripe"cannot be paid by Stripe Link.- Multiple challenges may cause wrong client selection if the user's wallet is not funded for the chosen method.
- Wallet keys exposed if the agent reads config files (do not
cat/read_file). - Server-side MPP tasks fail if this skill is used incorrectly.
Verification
Check your mppx installation and account:
mppx --version && mppx account list
Examples
- Probe a URL with
curl -ito confirm an MPP 402 response. - Pay a GET request:
mppx <url> - Pay a POST request with body:
mppx <url> --method POST --data '<json>' - Verify receipt:
mppx <url> -v - Tempo Wallet:
tempo wallet loginthentempo wallet pay <url>
Additional Notes
- Use
mpp decodeto inspect challenge or credential data when debugging. - Always run commands in a
terminalenvironment. - For zero-amount challenges, the
$0.00value indicates a proof-only credential.