curl -X POST https://xenarch.dev/v1/gates \
-H "X-Site-Token: st_abc123..." \
-H "Content-Type: application/json" \
-d '{"url": "/premium-article", "detection_method": "ua_match"}'
{
"xenarch": true,
"gate_id": "7f3a1b2c-9d4e-4a8b-b6f1-2c3d4e5f6a7b",
"price_usd": "0.003",
"splitter": "0xC6D3a6B6fcCD6319432CDB72819cf317E88662ae",
"collector": "0xabc123...publisher_wallet",
"network": "base",
"asset": "USDC",
"protocol": "x402",
"verify_url": "https://xenarch.dev/v1/gates/7f3a1b2c.../verify",
"expires": "2026-04-10T15:00:00Z"
}
Gates
Create Gate
Create an x402 payment gate session — returns HTTP 402 with payment instructions. The core API call for charging AI agents for content access.
POST
/
v1
/
gates
curl -X POST https://xenarch.dev/v1/gates \
-H "X-Site-Token: st_abc123..." \
-H "Content-Type: application/json" \
-d '{"url": "/premium-article", "detection_method": "ua_match"}'
{
"xenarch": true,
"gate_id": "7f3a1b2c-9d4e-4a8b-b6f1-2c3d4e5f6a7b",
"price_usd": "0.003",
"splitter": "0xC6D3a6B6fcCD6319432CDB72819cf317E88662ae",
"collector": "0xabc123...publisher_wallet",
"network": "base",
"asset": "USDC",
"protocol": "x402",
"verify_url": "https://xenarch.dev/v1/gates/7f3a1b2c.../verify",
"expires": "2026-04-10T15:00:00Z"
}
curl -X POST https://xenarch.dev/v1/gates \
-H "X-Site-Token: st_abc123..." \
-H "Content-Type: application/json" \
-d '{"url": "/premium-article", "detection_method": "ua_match"}'
{
"xenarch": true,
"gate_id": "7f3a1b2c-9d4e-4a8b-b6f1-2c3d4e5f6a7b",
"price_usd": "0.003",
"splitter": "0xC6D3a6B6fcCD6319432CDB72819cf317E88662ae",
"collector": "0xabc123...publisher_wallet",
"network": "base",
"asset": "USDC",
"protocol": "x402",
"verify_url": "https://xenarch.dev/v1/gates/7f3a1b2c.../verify",
"expires": "2026-04-10T15:00:00Z"
}
Notes
- Returns HTTP 402 (Payment Required), not 200
collectoris the publisher’s payout wallet addresssplitteris the Xenarch splitter contract address on Base- Gates expire after 30 minutes by default (
GATE_TTL_SECONDS) - Price is resolved from path-specific rules or site default
- Origin/Referer header must match the registered site domain
Headers
Response
Successful Response