p402-agent-setup

p402-agent-setup is a skill for Claude Code, Codex from Z333Q/p402-protocol. It costs 228 tokens per session (2,895 once invoked), scanned A, original, MIT.

A setup guide for P402, a service that routes AI requests to models and handles usage payments. It works with tools that accept an OpenAI-compatible API.

In plain words
What is it for?
Use it to configure agents built with OpenClaw, CrewAI, AutoGPT, LangChain, or custom Python and TypeScript code.
Why use it?
It explains how to connect an existing agent by changing its API address and key, while covering budgets, caching, and payment settlement.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: positional $N argument; built for openclaw.

Install

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.

agentmods
npx agentmods add skills/z333q/p402-protocol/p402-agent-setup
Any agent
npx skills add Z333Q/p402-protocol --skill p402-agent-setup
Clone the repo
git clone --depth 1 https://github.com/Z333Q/p402-protocol

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for p402-agent-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/z333q/p402-protocol/p402-agent-setup.svg)](https://agentmods.dev/skills/z333q/p402-protocol/p402-agent-setup)
Your own site
<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>
Per session 228 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,895 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 5d ago against content hash 44b7e7475593, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

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.

skills/p402-agent-setup/SKILL.md · 204 lines

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:

  1. Provider swap (5 minutes): Change baseURL to https://p402.io/api/v2 and set the API key. The agent gets 300+ model routing, semantic caching, and Billing Guard protection with zero code changes.

  2. MCP server (10 minutes): Install @p402/mcp-server globally or locally. The agent gains 6 tools for active session management, provider comparison, and health monitoring. The agent can self-manage its own budget.

  3. SDK or @p402/mpp-method integration (30 minutes): Import @p402/sdk for high-level operations, or @p402/mpp-method for 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:

  1. What agent framework? This determines provider configuration.
  2. What hosting environment? This determines secrets management.

Read the full file on GitHub · 204 lines

Files

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.

Changes

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.

  1. 5d ago First seen · 204 lines · 228 tokens per session scan A 44b7e7475593

Subscribe to this mod's changes

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.

Related

Other skills, from other repositories

finance-data

Get stock quotes, company info, market data, and crypto prices. No API key needed.

Bitterbot-AI/bitterbot-desktop · 22 tokens

frankfurter

Fetch currency exchange rates from the frankfurter.dev API.

a2aproject/a2a-samples · 14 tokens

financial-news

Stock quotes, price history, financial news, and analysis.

aws-samples/sample-strands-agent-with-agentcore · 14 tokens

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…

mission69b/t2000 · 164 tokens

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…

internet-court/internet-court-skill · 147 tokens

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…

internet-court/internet-court-skill · 231 tokens