ekx-x402listed
Install: claude install-skill Ekinoxis-evm/claude-skills
# x402
Pay-per-request HTTP payments settled in USDC on Base.
Alchemy's endpoint: `https://x402.alchemy.com` · Coinbase facilitator:
`https://api.cdp.coinbase.com/platform/v2/x402`
This file records *our* position on it, not the protocol spec.
---
## The idea
A server responds `402 Payment Required` with a `PAYMENT-REQUIRED` header describing
price and network. The client signs a USDC payment, retries with `PAYMENT-SIGNATURE`,
and gets the resource. Settlement is ~1 second on Base, no protocol fee, no account.
Headers: `PAYMENT-REQUIRED` → `PAYMENT-SIGNATURE` → `PAYMENT-RESPONSE`.
Networks are CAIP-2: Base mainnet is `eip155:8453`, Base Sepolia `eip155:84532`.
Schemes: `exact` (fixed price) or `upto` (usage-based, EVM only).
---
## Why it matters to us
It is the only clean answer to *"how does an autonomous agent pay for something?"*
No API key to provision, no subscription, no human in the loop. That maps directly
onto a P2P agent and any future Ekinoxis agent product.
It is **early**. Treat it as a bet, not infrastructure — build the paid endpoint so
that x402 is one payment path among others, not the only door.
---
## Seller (Next.js)
```ts
import { paymentMiddleware } from "@x402/next";
export const middleware = paymentMiddleware(
process.env.DESTINATION_WALLET!, // where USDC lands
{ "/api/score": { price: "$0.01", network: "eip155:8453" } },
{ url: "https://api.cdp.coinbase.com/platform/v2/x402" }, // facilitator
);
```
## Buyer
```ts
impo