Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/z333q/p402-protocol/p402-agent-setupnpx skills add Z333Q/p402-protocol --skill p402-agent-setupgit clone --depth 1 https://github.com/Z333Q/p402-protocolWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/z333q/p402-protocol/p402-agent-setup)<a href="https://agentmods.dev/skills/z333q/p402-protocol/p402-agent-setup"><img src="https://agentmods.dev/badge/skills/z333q/p402-protocol/p402-agent-setup.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00228 | $0.02895 |
| Opus 5 | $0.00114 | $0.01448 |
| Sonnet 5 | $0.00046 | $0.00579 |
| Haiku 4.5 | $0.00023 | $0.00290 |
Grade A, and why
p402-agent-setup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 204 lines — stays where its author put it; the contents beside it link to each section on GitHub.
P402 Agent Setup Skill
Help developers integrate P402 as the AI routing and payment infrastructure for autonomous agents. The goal is the cleanest possible path from "I have an agent running somewhere" to "my agent routes all inference through P402 with budget caps, semantic caching, and on-chain settlement on Base or Tempo."
Core Context
P402 is an OpenAI-compatible API. Any agent framework or tool that can call an OpenAI-style endpoint can use P402 as a drop-in provider. This is the key architectural insight: P402 is not a plugin or SDK dependency. It is a base URL swap.
P402 settles on multiple rails:
- Base mainnet (chain 8453) for USDC and EURC via EIP-3009 gasless transfers
- Tempo mainnet (chain 4217) for USDC.e, USDT0, cUSD, and seven other TIP-20 stablecoins, with gas paid in stablecoin
Auto-routing picks the cheaper rail by default (Tempo, when both are healthy). Users can override per request.
The three integration depths, from simplest to richest:
-
Provider swap (5 minutes): Change
baseURLtohttps://p402.io/api/v2and set the API key. The agent gets 300+ model routing, semantic caching, and Billing Guard protection with zero code changes. -
MCP server (10 minutes): Install
@p402/mcp-serverglobally or locally. The agent gains 6 tools for active session management, provider comparison, and health monitoring. The agent can self-manage its own budget. -
SDK or
@p402/mpp-methodintegration (30 minutes): Import@p402/sdkfor high-level operations, or@p402/mpp-methodfor direct mppx-protocol integration when building custom server infrastructure.
Most agent users want option 1 or 2. Reach for option 3 only when building a custom agent framework, integrating mppx directly, or needing programmatic control over sessions and mandates.
Decision Tree
When a user describes their setup, identify two things:
- What agent framework? This determines provider configuration.
- What hosting environment? This determines secrets management.
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 204 lines · 228 tokens per session scan A 44b7e7475593
p402-agent-setup is a skill published in the GitHub repository Z333Q/p402-protocol (0 stars, last pushed 1mo ago), licensed MIT. It adds 228 tokens to every session and 2,895 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
finance-data
Get stock quotes, company info, market data, and crypto prices. No API key needed.
frankfurter
Fetch currency exchange rates from the frankfurter.dev API.
financial-news
Stock quotes, price history, financial news, and analysis.
t2000-job
Escrow USDC for agent-to-agent deliverable work (A2A jobs). Use when hiring another agent for async work (research reports, builds, SLA tasks) or when selling deliverable work yourself (list a service: fixed price + SLA, no server needed), or posting/claiming open jobs on the board (t2 job open / claim) — anything…
internet-court
Entry point for Internet Court — the trust layer for agent-to-agent commerce. Use whenever an agent needs to transact with another agent or a paid service, or a user mentions agent payments, paid APIs (HTTP 402/x402), wallet custody or trust concerns, spending mandates, delegated permissions (ERC-7710/7715), escrow…
okx-agent-payments-protocol
Use when an agent hits HTTP 402 / payment-required, or the user mentions x402, x402Version, X-PAYMENT, PAYMENT-REQUIRED, PAYMENT-SIGNATURE, WWW-Authenticate: Payment, permit2, upto, metered billing, a payment channel / voucher / session, channelId / channelid, opening / closing / topping up / settling / refunding a…