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 skills add Z333Q/p402-protocol --skill p402git 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)<a href="https://agentmods.dev/skills/z333q/p402-protocol/p402"><img src="https://agentmods.dev/badge/skills/z333q/p402-protocol/p402/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/z333q/p402-protocol/p402"><img src="https://agentmods.dev/badge/skills/z333q/p402-protocol/p402.svg" alt="Reviewed on agentmods" width="80" 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.00171 | $0.02707 |
| Opus 5.5 | $0.00068 | $0.01083 |
| Sonnet 5.5 | $0.00034 | $0.00541 |
| Haiku 4.5 | $0.00017 | $0.00271 |
Grade A, and why
p402 scanned grade A with 1 finding 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 3mo 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
For complete request/response schemas and code examples in TypeScript, Python, and curl, read `references/api-reference.md`. How it starts
The opening of the file, as written. The whole thing — 173 lines — stays where its author put it; the contents beside it link to each section on GitHub.
P402: Payment-Aware AI Orchestration
P402.io is an infrastructure layer that solves two problems at once: fragmented AI provider APIs and broken micropayment economics. It routes LLM requests to the optimal provider based on cost, speed, or quality, while settling payments in USDC/USDT on Base blockchain using the x402 protocol.
The key mental model: P402 sits between your application and AI providers the same way a payment network sits between merchants and banks. It handles routing, authorization, and settlement so your code just makes API calls.
Why P402 Exists
Traditional payment processors charge ~$0.30 per transaction, which makes micropayments for AI API calls (often $0.001-$0.05) economically impossible. P402 uses stablecoin settlement on Base L2 where transaction costs are fractions of a cent, enabling true pay-per-request economics for AI agents.
Most AI applications are "cost-blind" -- they hardcode a single provider and overpay by 70-85%. P402 makes applications "cost-aware" by exposing real-time pricing across 300+ models and routing intelligently.
Core Concepts
The Session Lifecycle
Sessions are the foundational primitive. Every interaction with P402 flows through a session:
- Create a session with a budget cap and optional policies
- Fund the session (USDC via Base Pay, direct transfer, or test credits)
- Use the session for chat completions -- P402 tracks spending per request
- Expire -- sessions auto-close when budget is exhausted or time limit is reached
Sessions enforce spending boundaries. An agent with a $10 session physically cannot spend $10.01. This is the core safety mechanism for autonomous agent spending.
Routing Modes
Every chat completion request can specify a routing mode that controls how P402 selects the provider and model:
| Mode | Optimizes For | Best For | Typical Provider |
|---|---|---|---|
cost |
Lowest price, acceptable quality | Batch processing, background tasks, high-volume | DeepSeek V3.2, Haiku 4.5, GPT-4o-mini |
quality |
Best output, price secondary | Final outputs, complex reasoning, user-facing answers | Claude Opus 4.6, GPT-5.2, Gemini 3.1 Pro |
speed |
Lowest latency, price secondary | Real-time chat, interactive UX, streaming | Groq (LPU), Flash models |
balanced |
Equal weight across all factors | General purpose, default choice | Sonnet 4.6, GPT-4o-mini, Gemini 3.1 Pro |
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.
- 3mo ago First seen · 173 lines · 171 tokens per session scan A 91759ede660a
p402 is a skill published in the GitHub repository Z333Q/p402-protocol (0 stars, last pushed 4mo ago), licensed MIT. It adds 171 tokens to every session and 2,707 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
p402 compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| p402Z333Q/p402-protocol | Skill | 0 | 4mo ago | MIT | A | 171 | Claude Code, Codex |
| wallet-paymentsBitterbot-AI/bitterbot-desktop | Skill | 2.5k | 2d ago | MIT | A | 57 | Claude Code, Codex |
| okx-agent-payments-protocolinternet-court/internet-court-skill | Skill | 7.2k | 6d ago | none | A | 231 | Claude Code |
| okx-dapp-discoveryinternet-court/internet-court-skill | Skill | 7.2k | 6d ago | none | A | 351 | Claude Code |
| jupiter-lendinternet-court/internet-court-skill | Skill | 7.2k | 6d ago | none | A | 68 | Claude Code |
| lifiinternet-court/internet-court-skill | Skill | 7.2k | 6d ago | none | A | 299 | Claude Code |
| pythinternet-court/internet-court-skill | Skill | 7.2k | 6d ago | none | A | 48 | Claude Code |