curl -X POST https://api.xenarch.dev/v1/gates \
-H "X-Site-Token: st_abc123..." \
-H "Origin: https://example.com" \
-H "Content-Type: application/json" \
-d '{"url": "/premium-article", "detection_method": "ua_match"}'
{
"x402Version": 1,
"accepts": [
{
"scheme": "exact",
"network": "base",
"maxAmountRequired": "3000",
"resource": "https://example.com/premium-article",
"description": "Access to https://example.com/premium-article",
"mimeType": "text/html",
"payTo": "0x1111111111111111111111111111111111111111",
"maxTimeoutSeconds": 1800,
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"extra": { "name": "USD Coin", "version": "2" }
}
],
"error": null,
"xenarch": true,
"gate_id": "7f3a1b2c-9d4e-4a8b-b6f1-2c3d4e5f6a7b",
"price_usd": "0.0030",
"seller_wallet": "0x1111111111111111111111111111111111111111",
"network": "base",
"asset": "USDC",
"protocol": "x402",
"facilitators": [
{ "name": "PayAI", "url": "https://facilitator.payai.network", "spec_version": "v2" },
{ "name": "xpay", "url": "https://facilitator.xpay.sh", "spec_version": "v2" },
{ "name": "Mogami", "url": "https://facilitator.mogami.tech", "spec_version": "v1" },
{ "name": "Heurist", "url": "https://facilitator.heurist.xyz", "spec_version": "v2" },
{ "name": "Daydreams", "url": "https://facilitator.daydreams.systems", "spec_version": "v2" }
],
"verify_url": "https://api.xenarch.dev/v1/gates/7f3a1b2c-9d4e-4a8b-b6f1-2c3d4e5f6a7b/verify",
"expires": "2026-11-17T15:30:00Z"
}
Gates
Create Gate
Create an x402 payment gate for a URL. Returns HTTP 402 with x402 version 1 payment requirements that pay the publisher’s own wallet.
POST
/
v1
/
gates
curl -X POST https://api.xenarch.dev/v1/gates \
-H "X-Site-Token: st_abc123..." \
-H "Origin: https://example.com" \
-H "Content-Type: application/json" \
-d '{"url": "/premium-article", "detection_method": "ua_match"}'
{
"x402Version": 1,
"accepts": [
{
"scheme": "exact",
"network": "base",
"maxAmountRequired": "3000",
"resource": "https://example.com/premium-article",
"description": "Access to https://example.com/premium-article",
"mimeType": "text/html",
"payTo": "0x1111111111111111111111111111111111111111",
"maxTimeoutSeconds": 1800,
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"extra": { "name": "USD Coin", "version": "2" }
}
],
"error": null,
"xenarch": true,
"gate_id": "7f3a1b2c-9d4e-4a8b-b6f1-2c3d4e5f6a7b",
"price_usd": "0.0030",
"seller_wallet": "0x1111111111111111111111111111111111111111",
"network": "base",
"asset": "USDC",
"protocol": "x402",
"facilitators": [
{ "name": "PayAI", "url": "https://facilitator.payai.network", "spec_version": "v2" },
{ "name": "xpay", "url": "https://facilitator.xpay.sh", "spec_version": "v2" },
{ "name": "Mogami", "url": "https://facilitator.mogami.tech", "spec_version": "v1" },
{ "name": "Heurist", "url": "https://facilitator.heurist.xyz", "spec_version": "v2" },
{ "name": "Daydreams", "url": "https://facilitator.daydreams.systems", "spec_version": "v2" }
],
"verify_url": "https://api.xenarch.dev/v1/gates/7f3a1b2c-9d4e-4a8b-b6f1-2c3d4e5f6a7b/verify",
"expires": "2026-11-17T15:30:00Z"
}
curl -X POST https://api.xenarch.dev/v1/gates \
-H "X-Site-Token: st_abc123..." \
-H "Origin: https://example.com" \
-H "Content-Type: application/json" \
-d '{"url": "/premium-article", "detection_method": "ua_match"}'
{
"x402Version": 1,
"accepts": [
{
"scheme": "exact",
"network": "base",
"maxAmountRequired": "3000",
"resource": "https://example.com/premium-article",
"description": "Access to https://example.com/premium-article",
"mimeType": "text/html",
"payTo": "0x1111111111111111111111111111111111111111",
"maxTimeoutSeconds": 1800,
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"extra": { "name": "USD Coin", "version": "2" }
}
],
"error": null,
"xenarch": true,
"gate_id": "7f3a1b2c-9d4e-4a8b-b6f1-2c3d4e5f6a7b",
"price_usd": "0.0030",
"seller_wallet": "0x1111111111111111111111111111111111111111",
"network": "base",
"asset": "USDC",
"protocol": "x402",
"facilitators": [
{ "name": "PayAI", "url": "https://facilitator.payai.network", "spec_version": "v2" },
{ "name": "xpay", "url": "https://facilitator.xpay.sh", "spec_version": "v2" },
{ "name": "Mogami", "url": "https://facilitator.mogami.tech", "spec_version": "v1" },
{ "name": "Heurist", "url": "https://facilitator.heurist.xyz", "spec_version": "v2" },
{ "name": "Daydreams", "url": "https://facilitator.daydreams.systems", "spec_version": "v2" }
],
"verify_url": "https://api.xenarch.dev/v1/gates/7f3a1b2c-9d4e-4a8b-b6f1-2c3d4e5f6a7b/verify",
"expires": "2026-11-17T15:30:00Z"
}
Notes
- Returns HTTP 402, not 200. Your integration passes this body to the bot.
- The body is the x402 version 1 envelope (
x402Versionandaccepts) followed by Xenarch fields. See How it works. payToandseller_walletare the publisher’s wallet: the default receiving wallet chosen in the dashboard. The gate records it, so verification checks the same address. There is no Xenarch contract in the payment path.maxAmountRequiredis the price in USDC atomic units (6 decimals).facilitatorslists the x402 facilitators the agent may settle through. Agents may also use their own.- The price comes from the site’s pricing rules: the longest matching rule wins, otherwise the site default applies.
- An unpaid gate expires after 30 minutes.
- If the request carries an
OriginorRefererheader, it must match the site’s domain, or the request returns HTTP 403. Server-to-server calls without either header are accepted. - A site created without a domain claims it from the first gate request that carries
OriginorReferer. Until then, a request without either header returns HTTP 409. detection_methodis an optional label recorded with the gate.
Response
Successful Response