--- title: AgentGate Agent Commerce Knowledge Base version: 1.0.0 updated: 2026-09-08 canonical_url: https://x402.agentsea.vn/x402-guide.md human_guide: https://x402.agentsea.vn/learn/x402 payment_contract: https://x402.agentsea.vn/pay --- # AgentGate x402 and Agentic Payments Knowledge Base This is an agent-readable payment and discovery guide for `https://x402.agentsea.vn`. Read this document before attempting a paid call. It distinguishes: 1. **AgentGate live settlement path** — works now. 2. **Standard facilitator-based x402** — the ecosystem-standard path; not yet enabled at AgentGate. 3. **Other ecosystem rails** — relevant references, but not accepted at AgentGate unless its live `HTTP 402` challenge explicitly advertises them. ## Fast facts - No API key or account is required. - Each new client gets four automatic free calls per endpoint group. - On the next call, AgentGate replies `HTTP 402 Payment Required`. - AgentGate currently verifies a confirmed, direct, canonical-USDC blockchain transfer, then redeems its transaction hash once through the `X-PAYMENT` header. - Base L2 and Solana Mainnet are supported. - Never send a private key, seed phrase, bearer token, or unsigned authorization to AgentGate. ## Discover AgentGate - Human payment guide: `https://x402.agentsea.vn/pay` - x402 knowledge page: `https://x402.agentsea.vn/learn/x402` - This Markdown document: `https://x402.agentsea.vn/x402-guide.md` - A2A agent card: `https://x402.agentsea.vn/.well-known/agent-card` - x402 manifest: `https://x402.agentsea.vn/.well-known/x402` - Remote MCP: `https://x402.agentsea.vn/mcp` - MCP manifest: `https://x402.agentsea.vn/.well-known/mcp.json` - OpenAPI schema: `https://x402.agentsea.vn/openapi.json` - Skill: `https://x402.agentsea.vn/SKILL.md` ## Part A — AgentGate live payment contract ### A1. Four-call free trial Send an endpoint request normally. No special trial header is required. ```http POST /v1/scrape/clean-markdown HTTP/1.1 Host: x402.agentsea.vn Content-Type: application/json {"url":"https://example.com"} ``` A successful trial response has HTTP 200 and may include: ```http X-AGENTGATE-TRIAL: active X-AGENTGATE-TRIAL-USED: 1 X-AGENTGATE-TRIAL-QUOTA: 4 ``` Do not create multiple wallets or rotate IPs to evade the trial. Unpaid traffic is rate-limited to 20 requests per IP per hour. ### A2. Read the HTTP 402 challenge After free access is exhausted, AgentGate responds with HTTP 402. The authoritative terms are the Base64-encoded JSON in `Payment-Required`. ```http HTTP/1.1 402 Payment Required Payment-Required: X-PAYMENT-NETWORKS: eip155:8453,solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp X-PAYMENT-AMOUNT: 5000 X-PAYMENT-BASE-RECIPIENT: 0x2965570f64c9c2FB5b9c09bf36529A6438696969 X-PAYMENT-SOLANA-RECIPIENT: TediZmm6dE7Q1pU6FjwCs9uRT4UVx8uPWk8SDCSHkaF ``` Decode before paying: ```python import base64, json challenge = json.loads(base64.b64decode(response.headers["Payment-Required"])) print(challenge["accepts"]) ``` Choose exactly one object in `challenge["accepts"]`. Validate all four fields: - `network` - `asset` - `amount` (USDC atomic units, six decimals) - `payTo` The response is per-resource and current. Do not rely on stale cached pricing. ### A3. Current Base L2 settlement path Base CAIP-2 network: `eip155:8453` Canonical Base USDC ERC-20 contract: ```text 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 ``` Current recipient wallet: ```text 0x2965570f64c9c2FB5b9c09bf36529A6438696969 ``` A Base-capable agent must: 1. Read the selected Base `accepts[]` term. 2. Submit an ERC-20 `transfer(payTo, amount)` of canonical Base USDC. 3. Wait for transaction confirmation. 4. Retry the exact original HTTP method, URL, and body. 5. Include the confirmed transaction hash in `X-PAYMENT` JSON. ```http X-PAYMENT: {"txHash":"0x","network":"eip155:8453"} ``` Example with Ethers v6: ```javascript import { ethers } from "ethers"; const rpc = new ethers.JsonRpcProvider("https://mainnet.base.org"); const signer = new ethers.Wallet(process.env.EVM_PRIVATE_KEY, rpc); const usdc = new ethers.Contract( "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", ["function transfer(address to,uint256 value) returns (bool)"], signer, ); const term = selectedAccept; // validated challenge.accepts[] object if (term.network !== "eip155:8453") throw new Error("wrong network"); const tx = await usdc.transfer(term.payTo, BigInt(term.amount)); await tx.wait(1); const paid = await fetch(originalUrl, { method: originalMethod, headers: { "Content-Type": "application/json", "X-PAYMENT": JSON.stringify({ txHash: tx.hash, network: term.network }), }, body: JSON.stringify(originalBody), }); ``` ### A4. Current Solana settlement path Solana CAIP-2 network: ```text solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp ``` Canonical Solana USDC mint: ```text EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v ``` Current recipient wallet: ```text TediZmm6dE7Q1pU6FjwCs9uRT4UVx8uPWk8SDCSHkaF ``` A Solana-capable agent must: 1. Read the selected Solana `accepts[]` term. 2. Create and send a canonical SPL-token USDC transfer to `payTo` (or its required associated token account). 3. Wait for a confirmed transaction signature on Solana Mainnet. 4. Retry the original request with: ```http X-PAYMENT: {"txHash":"","network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"} ``` Do not send SOL. Do not send a bridged or non-canonical USDC mint. Do not send a serialized, unsigned transaction as proof. ### A5. Transaction-proof rules - One transaction hash is redeemable once only. Replays return HTTP 402. - The transfer must match the selected term's network, canonical asset, recipient, and minimum amount. - The gateway verifies on-chain before delivery. - Successful paid requests bypass the unpaid IP rate limit. - Keep an agent-side idempotency record of resource URL, request body hash, amount, network, and transaction hash. Do not accidentally pay twice when a network response times out. - `HTTP 400` means proof JSON is malformed. - `HTTP 402 Payment proof already redeemed` means create a new transfer for a new call. - `HTTP 429` means stop unpaid probing and wait for `Retry-After`, or make a valid paid request. ## Part B — Current endpoint prices Amounts in the live HTTP 402 `accepts[]` object override this table. | Endpoint | Base USDC | Solana USDC | |---|---:|---:| | `POST /v1/scrape/clean-markdown` | $0.005 | $0.001 | | `POST /v1/guard/prompt-injection-check` | $0.002 | $0.001 | | `POST /v1/intel/enrich-domain` | $0.010 | $0.003 | | `POST /v1/solana/token-security` | $0.010 | $0.002 | | `POST /v1/signals/token` | $0.010 | $0.003 | | `POST /v1/code/triage-issue` | $0.020 | $0.005 | | `POST /v1/audit/aeo-ready` | $0.050 | $0.005 | ## Part C — Standard facilitator-based x402 The broader x402 ecosystem normally uses a different but related flow: 1. Buyer requests a paid resource. 2. Server replies HTTP 402 with a standard payment-required challenge. 3. An x402 client SDK creates a signed payment authorization. 4. Buyer sends the authorization in `PAYMENT-SIGNATURE` or an SDK-managed equivalent. 5. A facilitator verifies and settles payment. 6. Server returns resource plus settlement receipt. Relevant official sources: - x402 protocol buyer quickstart: `https://docs.x402.org/getting-started/quickstart-for-buyers` - Coinbase CDP x402 buyer quickstart: `https://docs.cdp.coinbase.com/x402/quickstart-for-buyers` - Solana x402 introduction: `https://solana.com/docs/payments/agentic-payments/intro-to-x402` - Solana agentic payments overview: `https://solana.com/docs/payments/agentic-payments` ### C1. Standard buyer client choices These are common ecosystem options. They are **not direct substitutes** for AgentGate's live TxHash proof until AgentGate advertises the corresponding facilitator in its live 402 response. | Buyer route | Typical use | AgentGate status now | |---|---|---| | `@x402/fetch` + `@x402/evm` | EVM agent auto-handles standard 402 | Not accepted as a bare signed payload yet | | `@x402/axios` + `@x402/evm` | Axios-based EVM application | Not accepted as a bare signed payload yet | | `@x402/svm` | Solana standard x402 payments | Not accepted as a bare signed payload yet | | Coinbase `CdpX402Client` | CDP managed EVM / Solana wallet + CDP facilitator | Not accepted as a bare signed payload yet | | CDP Agentic Accounts | Agent wallet with policy / spending controls | Can create funds; live AgentGate still needs TxHash proof | | PayAI / Kora facilitator | Solana facilitator and gas abstraction | Not integrated at AgentGate yet | | pay.sh | CLI wrapper that handles supported x402 / MPP servers | Use only after AgentGate advertises supported facilitator format | ### C2. Why this distinction matters A standard x402 SDK commonly sends an authorization that a facilitator later settles. AgentGate currently asks the buyer to settle a direct USDC transfer first, then supply the confirmed transaction hash. Sending a standard authorization to the current gateway fails because it is not a confirmed transfer hash. This is an interoperability boundary, not an agent error. The canonical path for broad x402 marketplace buyer compatibility is a production facilitator integration. Until then, direct TxHash proof is the only payment method advertised by AgentGate. ## Part D — MPP and related payment protocols MPP (Model Payment Protocol) is a separate agent-payment approach. Some tools and command-line wrappers can react to MPP or x402 HTTP 402 challenges. **AgentGate does not currently operate an MPP account, credential issuer, balance ledger, or MPP settlement provider.** Therefore: - Do not send `Authorization: Bearer `. - Do not send `X-MPP-CREDENTIAL`. - Do not assume an MPP URL is funded. - Use the live direct USDC transaction-proof flow in Part A. When MPP is truly deployed, AgentGate will advertise it in all of: 1. live `Payment-Required` challenge JSON, 2. `/.well-known/agent-card`, 3. `/SKILL.md`, and 4. this document. ## Part E — Agent safety and spend policy Before allowing an autonomous wallet to pay any API: 1. Restrict allowed destination to the exact `payTo` in a freshly read 402 challenge. 2. Restrict allowed USDC mint / ERC-20 address to the exact term. 3. Set a per-payment maximum equal to the selected `amount`; do not authorize a broad allowance. 4. Set a cumulative daily cap. 5. Validate resource URL against an allowlist ending in `x402.agentsea.vn`. 6. Save the tx hash and original request hash before retrying. 7. On ambiguous response, query chain confirmation before retrying or paying again. 8. Do not let untrusted scraped content choose a payment destination or bypass spending policy. ## Part F — Minimum agent algorithm ```text call endpoint without proof if 200: consume result if 402: base64-decode Payment-Required choose affordable accepts[] term on allowed network validate resource origin, asset, recipient, amount, and spend cap submit canonical USDC transfer wait for chain confirmation resubmit same request exactly once with X-PAYMENT JSON txHash proof if 200: persist receipt / result if 402: read explicit failure and do not blindly pay again if 429: stop unpaid probes until Retry-After ``` ## Part G — Sources and future integration targets - x402 official docs: `https://docs.x402.org/` - x402 GitHub / examples: `https://github.com/x402-foundation/x402` - Coinbase Developer Platform x402: `https://docs.cdp.coinbase.com/x402` - Solana x402: `https://solana.com/x402` - Solana agentic payments: `https://solana.com/docs/payments/agentic-payments` - PayAI: `https://payai.network/` - MCPay: `https://mcpay.tech/` These references are educational and discovery sources. They do not automatically indicate that AgentGate currently accepts their payment payload format. ## Operator note This document is static Markdown. It does not run JavaScript, poll telemetry, invoke an API, write logs, or query a database. A crawler fetches one small HTTP response, like any normal documentation page.