A2A PaymentsINK Chain 57073

Agent-to-Agent
x402 Payments

The facilitator for INK blockchain. Accept USDC payments between agents, APIs, and services with one endpoint. No API keys. No gas. No blockchain code.

Sub-second settlementNo API keys neededNetwork fees covered

Why Castar Facilitator

Payment infrastructure for the agentic economy

Everything you need to monetize APIs and services with USDC on INK. Built for developers and AI agents.

Built for AI Agents

x402 is designed for programmatic payments. AI agents with wallets pay for API access autonomously — no human intervention.

One Line Integration

Add payment middleware to your Express, Hono, or Axum server. Set your price. The facilitator handles everything else.

USDC on INK

Settle payments in USDC on Kraken's Layer 2. Fast, cheap, and backed by real dollars. Chain ID 57073.

No API Keys

No registration, no dashboard, no API keys. Point your server at the facilitator URL and start accepting payments.

Non-Custodial

The facilitator never holds funds. It only executes pre-authorized EIP-3009 transfers signed by the payer.

Sub-Second Settlement

Payments verify and settle on INK in under a second. Your server gets a receipt with the transaction hash.

Integration

Add payments in minutes

See how easy it is to add x402 payments to your server and client.

Seller — Protect your API

server.tswithout x402
// Your Express server - no payments
import express from 'express';
const app = express();

app.get('/api/data', (req, res) => {
  res.json({ data: 'free access' });
});

app.listen(3000);
server.tswith x402
// Add x402 payments in 3 lines
import express from 'express';
import { paymentMiddleware } from 'x402-express';
const app = express();

app.use('/api/data', paymentMiddleware({
  facilitatorUrl: 'https://relay.castar.tech',
  network: 'ink',
  amount: 0.01,
  token: 'USDC',
  recipient: '0xYourAddress',
}));

app.get('/api/data', (req, res) => {
  res.json({ data: 'paid access' });
});

app.listen(3000);

Buyer — Pay automatically

client.tsstandard fetch
// Standard fetch — gets 402 error
const response = await fetch(
  'https://api.example.com/api/data'
);

// Error: 402 Payment Required
console.log(response.status); // 402
client.tsx402 fetch
// x402 fetch — auto-pays and retries
import { withX402Payment } from 'x402-fetch';

const response = await withX402Payment(
  fetch('https://api.example.com/api/data'),
  {
    wallet: signer,
    network: 'ink',
  }
);

// Paid & received
const data = await response.json();

The Protocol

How it works

Your server says “pay me.” The client pays. The facilitator verifies and settles on INK. No redirects, no checkout pages.

01

Server Returns 402

Your server responds with HTTP 402 on a paid route. The header includes price, token (USDC), and your INK recipient address.

02

Client Signs & Retries

The client reads the payment requirement, signs a USDC authorization with their wallet, and retries the request.

03

Facilitator Verifies

Castar Facilitator validates the signature, amount, token, expiration, and on-chain state on INK.

04

Settled on INK

The facilitator submits the USDC transfer via EIP-3009, returns a receipt with the txHash, and your server grants access.

API Reference

Facilitator Endpoints

Available on this facilitator instance. Use these for custom integrations or to inspect the payment flow.

POST/verify

Submit a signed payment for verification. Checks signature, amount, token, and on-chain state.

POST/settle

Settle an accepted payment on-chain. Returns a receipt with the transaction hash.

GET/supported

Lists all payment kinds this facilitator supports — schemes, chains, and versions.

GET/health

Health check. Returns 200 when the facilitator is running and ready.

GET/metrics

Prometheus metrics endpoint. Tracks settlements, verifications, latency, and uptime.

GET/stats

JSON stats for the landing page. Returns settlement count and uptime seconds.

Facilitator Base URL

https://relay.castar.tech

0

Settlements

1.2s

Avg Settlement

99.97%

Uptime

Castar · x402

Start Accepting
Payments on INK

Set one environment variable. Choose INK as your network. Deploy. The facilitator handles the rest.