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.

Good fit Use it to configure agents built with OpenClaw, CrewAI, AutoGPT, LangChain, or custom Python and TypeScript code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/z333q/p402-protocol/p402-agent-setup
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.

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/github.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/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.

agentmods 80×15 button for p402-agent-setup

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.5 $0.00091 $0.01158
Sonnet 5.5 $0.00046 $0.00579
Haiku 4.5 $0.00023 $0.00290

Measured 2mo ago against content hash 44b7e7475593, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 3mo ago), licensed MIT. It adds 228 tokens to every session and 2,895 once invoked, about $0.0009 per session on Opus 5.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

p402-agent-setup compared with skills from other repositories

p402-agent-setup next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
p402-agent-setupZ333Q/p402-protocolSkill03mo agoMITA228Claude Code, Codex
finance-dataBitterbot-AI/bitterbot-desktopSkill2.5ktodayMITA22Claude Code, Codex
wallet-paymentsBitterbot-AI/bitterbot-desktopSkill2.5ktodayMITA57Claude Code, Codex
forage-economyBitterbot-AI/bitterbot-desktopSkill2.5ktodayMITA50Claude Code, Codex
frankfurtera2aproject/a2a-samplesSkill1.8k18d agoApache-2.0A14Claude Code, Codex
financial-newsaws-samples/sample-strands-agent-with-agentcoreSkill198yesterdayMITA14Claude Code, Codex
internet-courtinternet-court/internet-court-skillSkill7.1k13d agononeA147Claude Code