P402 Router is an AI routing control plane that transforms every AI API call into a metered economic event with an owner, a budget, and a margin. It sits between paid endpoints and facilitators, enforcing spend controls and settling payments in USDC on the Base mainnet. Designed for developers, AI teams, and enterprises, P402 provides a single OpenAI-compatible endpoint that routes requests to over 300 models while publishing Bazaar-ready metadata for discovery. The core value is making AI spend accountable: turning token usage into a live cost ledger that can be attributed, audited, and optimized in real time. This product is live in production with real USDC settlements, offering a gasless payment experience through the EIP-3009 standard. By replacing a single URL in existing code, users gain automatic routing, cost savings, and full transparency into every request's economic footprint.
Before P402, teams faced uncontrolled AI spending with no per-request attribution, no margin control, and no way to enforce budgets across agents or accounts. The concrete problem is that AI API costs spiral without visibility: each call uses a different model, provider pricing varies, and there is no cryptographic mechanism to constrain spend. This matters because without a live cost ledger, organizations cannot attribute costs to specific features, users, or agents, making optimization impossible. P402 solves this by treating every token as an owned, tracked economic unit with a clear budget and margin. Token usage becomes a live cost ledger you can attribute, audit, and optimize, turning AI calls from opaque expenses into structured economic events that can be governed and reported on. This shift enables teams to hold AI spend accountable, reduce waste, and align costs with business outcomes.
The first major feature group is AI Routing, which automatically selects the optimal model for each request based on cost, speed, quality, or balanced mode. How it works: users write standard OpenAI-compatible code and change only the baseURL to https://p402.io/api/v2. P402 then routes each request across 300+ models, selecting the provider that best meets the user's cost and quality target. For example, a request to Claude Opus 4 might be routed to DeepSeek Chat, saving up to 97% on cost while maintaining output quality. The benefit is immediate cost savings without code changes, plus a semantic cache that further reduces expenses. Every routing decision is logged with a live trace showing cost versus baseline, latency, quality score, and provider attribution, all visible in the Intelligence Layer dashboard.
admin
The second major feature group is Payments, which handles gasless USDC settlement on Base Mainnet using the EIP-3009 transferWithAuthorization standard. How it works: the user signs an authorization with zero gas fees, P402 verifies the signature off-chain, a facilitator executes the transfer on-chain, and the user receives service instantly. Settlement occurs in under two seconds with a 1% platform fee. Receipts generated from the first payment allow repeat access without requiring re-payment, enabling pay-per-use models. The benefit is a frictionless payment experience with 100% gas savings for users, full transaction history on the dashboard, and a 99.9% uptime SLA from global edge deployment across 15 regions. Escrow is also built in: conditional USDC escrow locks funds on-chain, releasing only on confirmed delivery with a 48-hour dispute window.
The third feature group includes Controls and Orchestration. Controls are implemented through AP2 mandates that cryptographically constrain each agent's spend and policies that enforce account-wide limits. Every denied request returns a structured code with a requestId, enabling automated handling. Orchestration uses the A2A JSON-RPC 2.0 task protocol with SSE streaming, where payment-required events are structured messages—not errors. This allows agent-to-agent communication with built-in payment requirements. Additionally, the Ecosystem feature lets users publish typed skills, list paid agents on the Bazaar marketplace, and earn Verified Publisher status via ERC-8004 on-chain reputation, which is optional and toggleable. These features together provide a complete framework for building, governing, and monetizing AI agents with cryptographic accountability.
Overall, P402 works by providing a unified control plane that intercepts AI API calls and applies routing, payment, and governance logic before forwarding to providers. The workflow is simple: sign up free with no credit card, get an API key immediately, replace the base URL in existing OpenAI SDK code with https://p402.io/api/v2, and then let P402 handle routing automatically. The system is private by default—no prompt storage is required, and only metadata is metered. For enterprise deployment, a Private Gateway option provides full data isolation. Every request is traced end-to-end, with live cost tracking in the dashboard that updates every 5 seconds. The protocol is open source, built on Google's Agent-to-Agent (A2A) standard, and supports installations via VS Code extension, npx MCP server, or REST API.
Concrete use cases include a developer summarizing a legal contract in plain English: the request is routed from Claude Opus to DeepSeek Chat, reducing cost by 97% while preserving quality. Another scenario is an enterprise deploying the Private Gateway with gasless USDC payments, enabling compliance with data sovereignty requirements while still benefiting from model routing. A third use case is a team building an AI agent that automatically selects the best model per task—using P402's Cost, Speed, Quality, or Balanced modes to balance performance and budget. Outcome: teams gain full cost attribution per request, reduce AI spending by up to 97%, and can enforce spend policies across agents without any code changes. The Bazaar marketplace then allows listing these agents with runtime health signals like approval rate and settlement time, creating a distribution loop.
Target users are AI developers, engineering teams, product managers, and enterprises managing AI agent pipelines or API consumption. The product integrates with OpenAI SDK, VS Code, Cursor, Windsurf, Claude Desktop, JetBrains, and any REST client. Tech stack includes Base mainnet solidity contracts, EIP-3009 for gasless payments, ERC-8004 for reputation, and Cloudflare edge deployment across 15 regions. Pricing tiers include Free (no credit card, 1% platform fee), Pro ($499/month, 0.75% fee), and Enterprise (custom, volume-tiered). P402 Router is production-ready with 99.9% uptime, multisig treasury security (3-of-5 signatures), and a full audit trail. The summary takeaway: P402 makes AI spend accountable by turning every call into a metered, attributable, and optimizable economic event, giving teams control over costs without sacrificing performance.
AI developers integrating models via OpenAI SDK, engineering teams managing AI API costs, product managers overseeing AI feature budgets, agent builders deploying pay-per-use agents, enterprises requiring spend governance and data privacy, and organizations building multi-agent systems that need automatic routing and settlement. Also platform teams at startups and mid-market companies who want to eliminate manual provider switching and enforce spend policies without code changes. The solution is ideal for any team using AI APIs that wants to move from opaque costs to an accountable, traceable economic layer.