# onegate One-time authorisation and proof for irreversible agent actions. Base URL: https://onegate.biz.id ## Start here: preflight Before your agent pays a new x402 seller, call `POST /v1/x402/preflight`: ```json {"url":"https://www.api-xpay.com/x402/ping","maxPriceUsdc":0.01} ``` It costs $0.05, probes the seller, and returns a verdict (`pay_ok`, `caution`, or `do_not_pay`) plus the checks behind it. Use `expectedPayTo` when you already know the recipient, and `maxPriceUsdc` to cap the seller's price. ## Discovery - OpenAPI: `https://onegate.biz.id/openapi.json` - x402 resources: `https://onegate.biz.id/.well-known/x402` - Bazaar catalog: `https://onegate.biz.id/.well-known/x402.json` - RFC 9727 API catalog: `https://onegate.biz.id/.well-known/api-catalog` - MCP server (JSON-RPC, tool `x402_preflight`): `https://onegate.biz.id/mcp` - Halaman tanda tangan kepemilikan: `https://onegate.biz.id/sign` - MCP manifest: `https://onegate.biz.id/.well-known/mcp.json` - Agent Card (A2A): `https://onegate.biz.id/.well-known/agent-card.json` - Agent skill: `https://onegate.biz.id/skill.md` - Full guide: `https://onegate.biz.id/llms-full.txt` ## What this is 5 paid endpoints. One origin. Payment in USDC over x402. You pay for an ANSWER. Gate endpoints also return a single-use LEASE plus a signed RECEIPT that any third party can verify without paying. The preflight endpoint checks an x402 seller before your agent pays it. ## Pricing | endpoint | price | what you get | |---|---|---| | POST /v1/x402/preflight | $0.05 | Preflight an x402 endpoint before your agent pays. | | GET /v1/flow/solana | $0.02 | Per-token wallet flow on Solana, with full trader attribution. | | GET /v1/flow | $0.02 | Per-token wallet flow on EVM, returned as a delta since your last call. | | POST /v1/gate/send | $0.02 | Single-use authorisation for a transfer (native / ERC-20 / NFT), plus a signed receipt. | | POST /v1/gate/swap | $0.03 | Authorisation for a swap, with parameter validation, a lease, and a receipt. | Networks: eip155:8453, eip155:137, eip155:42161 (EVM only; Solana data is available, but Solana payment is not enabled yet) ## Exact call shapes ``` GET /v1/flow/solana?mint=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263&window=60&pools=5 GET /v1/flow?token=0x532f27101965dd16442E59d40670FaF5eBB142E4&network=eip155:8453&window=60 POST /v1/x402/preflight {"url":"https://www.api-xpay.com/x402/ping","maxPriceUsdc":0.01} ``` Every published URL is static. `token`, `mint`, `window` and `network` go in the query string, never in the path — a path template becomes an uncallable URL once it is listed in a public index. - `mint` (required): SPL token mint, base58, 32-44 chars. - `token` (required): EVM token contract address. - `network` (required for `/v1/flow`): CAIP-2 id, e.g. `eip155:8453`. - `window` (1..1440, default 60): how far back the FIRST call looks. - `pools` (1..10, default 5): top pools by liquidity to scan. - `url` (required for preflight): absolute http(s) URL of the x402 seller. Optional fields: `method`, `body`, `expectedPayTo`, `maxPriceUsdc`, `network`, `discoveryUrl`. Response fields that matter: `flow.netflow_usd` (signed), `wallets.new_entrants` and `wallets.exits` (addresses with net USD), `anchor.last_signature` (send it back implicitly — the server stores it per payer). ## When to call us - Call `/v1/flow/solana?mint=` **repeatedly** for the same token. The value is in the DELTA — the server remembers your last anchor per payer. First call returns a snapshot, later calls return only what changed. Calling once wastes the product. This is the only endpoint here that tells you WHICH wallet moved: on Solana every swap carries fromUserAccount/toUserAccount. EVM Swap V3 does not, which is why the EVM flow can only report totals. - Call `/v1/gate/send` or `/v1/gate/swap` **immediately before** signing an action you cannot undo. Not for dry runs, not for exploration. - Call `POST /v1/x402/preflight` **before paying a new x402 seller**. It probes the seller, parses the 402 challenge, and returns checks plus a verdict. It does not guarantee honest work; it catches malformed challenges, wrong recipients, price surprises, expired TLS, and weak domain identity. ## Never charged - Any `DENY` decision (duplicate action, consumed lease, expired lease, invalid parameters). - Any 4xx or 5xx. Every response carries a literal `"charged"` field. - Status checks: `/v1/verify?id=`, `/v1/lease?id=`, `/v1/gate/redeem`, `/v1/health`. ## Failover contract - `503` before the paywall: our data source is down. Retry elsewhere, you were not charged. - `402`: payment required, price is in the response header. - `200` with `decision: "DENY"`: your request was understood and refused. Read `reason` — retrying with the same parameters will refuse again, for free. ## Idempotency Send `idempotency_key` on gate endpoints. Same key + same payer = cached answer, `"charged": false`, no second payment. ## Gotchas - `amount`, `amount_in`, `min_out` are STRINGS in smallest units. `1000000` = 1 USDC on a 6-decimal token. Sending a number, not a string, is rejected. - `chain` is CAIP-2 (`eip155:8453`), not a name. - Leases expire in 5 minutes and are single-use. - Redeem a lease with `POST /v1/gate/redeem` BEFORE broadcasting the transaction. - Path forms (`/v1/flow/{token}`, `/v1/flow/solana/{mint}`, `/v1/lease/{id}`) are still served at runtime, but only the static query form is published in the index. --- --- name: onegate-preflight description: Verify an x402 seller before your agent pays it. Use when an agent is about to sign a 402 payment for an unfamiliar API, marketplace, or tool. --- # onegate — preflight an x402 seller One origin, USDC on Base / Polygon / Arbitrum, x402 v2. No account, no API key. ## When to use this Call `POST https://onegate.biz.id/v1/x402/preflight` **before** your agent signs a payment for a seller it has not paid before. It probes the seller, parses the 402 challenge, and returns a verdict plus the evidence behind it. ## Call it ```bash curl -X POST https://onegate.biz.id/v1/x402/preflight \ -H 'content-type: application/json' \ -d '{"url":"https://seller.example/v1/data","maxPriceUsdc":0.01}' ``` The first request answers HTTP 402 with the payment challenge in the `PAYMENT-REQUIRED` header. Sign it with any x402 client, retry with the `PAYMENT-SIGNATURE` header, and the paid response carries: ```json { "ok": true, "verdict": "pay_ok", "score": 84, "checks": [ { "id": "accept.amount", "status": "pass", "detail": "Price is $0.005000 USDC." } ] } ``` ## Input | field | required | meaning | |---|---|---| | `url` | yes | absolute http(s) URL of the x402 endpoint to check | | `method` | no | `GET` or `POST`; defaults to whatever the probe needs | | `body` | no | JSON body, for POST sellers that validate the body before returning 402 | | `expectedPayTo` | no | recipient address you already expect | | `maxPriceUsdc` | no | refuse sellers asking more than this | | `network` | no | required CAIP-2 network, e.g. `eip155:8453` | ## Reading the verdict - `pay_ok` — structurally valid challenge, no hard trust failures. Still check the work. - `caution` — payable, but at least one signal is weak. Start with the smallest payment. - `do_not_pay` — a hard failure: broken challenge, mismatched recipient, invalid certificate, or a dangerous address. ## What it checks 20 checks across five areas: the 402 challenge itself (resource binding, payTo, USDC asset, network, price, timeout), TLS and domain age, DNS and email authentication (SPF/DMARC), the payout wallet's history, and discoverability across three surfaces (facilitator Bazaar catalog, the seller's own `/.well-known/x402`, and the public x402 index). It cannot tell you whether the work is good. It tells you whether the seller is structurally sound before you sign anything. ## Other endpoints on this origin - `GET /v1/flow/solana` — $0.02 — Per-token wallet flow on Solana, with full trader attribution. - `GET /v1/flow` — $0.02 — Per-token wallet flow on EVM, returned as a delta since your last call. - `POST /v1/gate/send` — $0.02 — Single-use authorisation for a transfer (native / ERC-20 / NFT), plus a signed receipt. - `POST /v1/gate/swap` — $0.03 — Authorisation for a swap, with parameter validation, a lease, and a receipt. ## Discovery - OpenAPI: `https://onegate.biz.id/openapi.json` - x402 catalog: `https://onegate.biz.id/.well-known/x402.json` - Agent card: `https://onegate.biz.id/.well-known/agent-card.json` - Full guide: `https://onegate.biz.id/llms-full.txt`