For Developers

The payment API
built for agents.

x402 payments live on Base mainnet — USDC and EURC. TypeScript SDK, idempotent payments, HMAC-signed webhooks, delegated-custody signing. Under five minutes from `npm install` to first paid request.

Quick start

A few lines to a working agent payment.

Install payagent, drop in your API key, wrap your fetch. The first 402 challenge is paid and retried automatically, with your spend limits enforced before anything signs.

TypeScript
import { payFetchDelegated } from 'payagent';

const fetch402 = payFetchDelegated({
  arispayUrl: 'https://api.arispay.app',
  apiKey: process.env.ARISPAY_API_KEY,
});

// 402 challenge is paid automatically — spend limits enforced server-side.
const res = await fetch402('https://api.example.com/premium');

Two SDKs. One platform.

For agent builders

PayAgent

Agent-side x402 SDK. Wrap any fetch call with payFetchDelegated() and pay HTTP 402 challenges automatically. Vercel AI SDK + LangChain adapters included.

For merchants

PayGate

Server-side middleware. Drop paygateExpress() or paygateFastify() on any route to gate it behind a price. Settlement runs on Base mainnet through our open hosted facilitator — USDC and EURC, no fee, no gas subsidy.

Built like you'd build it.

The boring stuff is done. Spend the time on the agent, not the payments plumbing.

Idempotent by default

Every POST takes an Idempotency-Key. Retry as much as your network does. We dedupe on the server.

HMAC-signed webhooks

Every webhook carries an HMAC-SHA256 signature plus replay-protected timestamp. Verify in one helper call.

Delegated custody

x402 signing runs through Coinbase CDP. The key never touches your servers. Spend caps enforced before the signature.

One Payment schema

Every rail responds with the same Payment shape — amounts in integer cents, always. x402 is live; card and channels roll out behind the same contract.

Mock + live providers

PAYMENT_PROVIDER=mock for tests, live x402 settlement for prod. Same SDK, same response shape.

Stable error codes

Errors are strings, not HTTP statuses. SPEND_LIMIT_EXCEEDED, X402_PAYMENT_FAILED, CARD_DECLINED. Switch on them.

Everything you need.

API reference

Every endpoint, every parameter, every error.

SDK download

TypeScript + Python coming soon. npm-published, semver-stable.

Webhook guide

Event catalog, signature verification, retry semantics.

x402 protocol

How the HTTP 402 payment standard works under the hood.

Get your first paid request before this coffee gets cold.

Sign up, mint an API key, copy the snippet above. Real sandbox, real test wallet, real settlement on Base Sepolia.

Payment API for AI Agents | Arispay Developer Docs