Pay per call, no account · x402 across EVM and Solana · optional MPP
The REST pre-trade safety check can advertise x402 payment options on configured EVM and Solana networks; optional MPP remains on the configured EVM network. The full MCP catalog supports x402 and API keys. Payment is verified first and settled only after a successful check. Settlements are auditable on-chain, and verdicts carry verifiable attestations.
$0.02
Per check (C3)
USDC on configured EVM or Solana x402 networks; MPP remains EVM-only
0
Credentials
No account, no API key: the 402 quote is the contract
HTTP 402
Machine-native
Read the payment challenge, sign with the selected network scheme, retry
Signed
Verifiable verdict
Attestation receipts verify offline via verify-insight-receipt
01 — See the quote
Before writing any code, inspect what an agent sees. Protocol-specific response headers carry the quote: x402 clients read PAYMENT-REQUIRED, while MPP clients read WWW-Authenticate.
# Call without credentials: HTTP 402 with a PAYMENT-REQUIRED quote header
# The fixed entry label is optional aggregate attribution, never an identity.
curl -sD - -o /dev/null -H 'X-Insight-Entry-Source: docs' "https://www.oracleinsight.xyz/api/v1/safety/pre-trade?asset=ETH&chainId=1&action=swap&tradeAmountUsd=1000" \
| grep -i '^payment-required' | cut -d' ' -f2- | base64 --decode | jq
# Do not hard-code a payment network, asset, or payTo address from an example.
# The decoded live accepts[] list is the payment contract for this deployment.
# Register the scheme required by the option you select, sign it, retry, and read the verdict.02 — TypeScript
Wrap fetch with an x402 client and the 402 round trip disappears: the wrapper signs on the advertised standard EVM network, retries, and hands your code the verdict JSON. BNB Chain uses a separate AEON mandate scheme; the next sections cover that exception and Solana.
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from '@x402/fetch';
import { ExactEvmScheme, toClientEvmSigner } from '@x402/evm';
import { privateKeyToAccount } from 'viem/accounts';
const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY!);
const client = new x402Client().register(
'eip155:*',
new ExactEvmScheme(toClientEvmSigner(account)),
);
const fetchWithPay = wrapFetchWithPayment(fetch, client);
const res = await fetchWithPay('https://www.oracleinsight.xyz/api/v1/safety/pre-trade?asset=ETH&chainId=1&action=swap&tradeAmountUsd=1000', {
headers: { 'X-Insight-Entry-Source': 'docs' },
});
const check = await res.json();
console.log(check.verdict, check.recommendedMaxPositionUsd);
// This covers standard EIP-3009 EVM options. BNB Chain uses the AEON mandate
// scheme documented below; do not register the stock scheme for eip155:56.Configure comma-separated CAIP-2 ids in X402_EVM_NETWORKS to advertise multiple EVM chains. The registry includes Ethereum, OP Mainnet, Arbitrum, Polygon, Avalanche, Sei, X Layer, Monad, HyperEVM, BNB Chain, Base, and Base Sepolia. If the variable is unset, x402 uses only X402_NETWORK; that setting remains MPP's single EVM network. Use X402_PAY_TO for a shared recipient or X402_EVM_PAY_TOS for explicit network=recipient treasury isolation. Use X402_FACILITATOR_URLS for per-network network=https://facilitator routing. Only list networks advertised by that facilitator's /supported endpoint. HyperEVM uses eip155:999 with UVD'shttps://facilitator.ultravioletadao.xyz override.
03 — BNB Chain
Binance-Peg USDC has no EIP-3009 authorization entrypoint. A BNB payer must register Insight's AEON mandate scheme for eip155:56, which makes a one-time ERC-20 allowance transaction before signing the exact payment. The standard wildcard EVM example above must not be used for BNB.
The maintained adapter is exported by the Insight ElizaOS integration as ExactEvmMandateScheme and createMandateSignerFromKey. Use a dedicated, balance-capped agent key; the facilitator can pull the allowance granted by that key.
04 — Solana x402
When Solana is enabled on the deployment, the endpoint advertises a Solana x402 V2 exact option alongside the enabled EVM options. Register the Solana scheme in your client and keep its signer on the server or behind a spending-limited signing interface. The selected facilitator must advertise support for this exact network and scheme.
// npm i @x402/fetch @x402/svm @solana/kit @scure/base
import { base58 } from '@scure/base';
import { createKeyPairSignerFromBytes } from '@solana/kit';
import { wrapFetchWithPayment, x402Client } from '@x402/fetch';
import { ExactSvmScheme } from '@x402/svm/exact/client';
const secret = process.env.SOLANA_PRIVATE_KEY;
if (!secret) throw new Error('Set SOLANA_PRIVATE_KEY in the server environment');
const signer = await createKeyPairSignerFromBytes(base58.decode(secret));
const client = new x402Client().register(
'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
new ExactSvmScheme(signer),
);
const fetchWithPay = wrapFetchWithPayment(fetch, client);
// The API may advertise configured EVM and Solana options. This client selects Solana.
const res = await fetchWithPay('https://www.oracleinsight.xyz/api/v1/safety/pre-trade?asset=ETH&chainId=1&action=swap&tradeAmountUsd=1000', {
headers: { 'X-Insight-Entry-Source': 'docs' },
});
const check = await res.json();
console.log(check.verdict, check.recommendedMaxPositionUsd);
// Keep the signing key in a server-side or constrained signing service.Server setup uses X402_SOLANA_ENABLED, X402_SOLANA_NETWORK, and X402_SOLANA_PAY_TO. To route Solana through a different facilitator than EVM, add its CAIP-2 id to X402_FACILITATOR_URLS. Devnet uses solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1; mainnet uses solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp and is opt-in. Create the recipient USDC associated token account and confirm facilitator support before enabling it. Set X402_EVM_ENABLED=false when enabling Solana without activating an EVM recipient.
05 — MPP
When MPP is enabled on the deployment, the REST endpoint advertises an MPP evm charge offer alongside its x402 quote. The dedicated MCP pilot uses standard MPP challenge, credential, and receipt metadata. The mppx client handles challenges and sends its credential in Authorization: Payment. Both rails use the configured EVM price and USDC recipient. MPP does not use the Solana x402 option.
// npm i mppx viem
import { Mppx, evm } from 'mppx/client';
import { privateKeyToAccount } from 'viem/accounts';
const mppx = Mppx.create({
methods: [
evm.charge({
account: privateKeyToAccount(process.env.EVM_PRIVATE_KEY!),
networks: [8453],
currencies: ['0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'],
maxAmount: '0.02',
}),
],
});
// mppx reads the MPP challenge, signs the EIP-3009 authorization,
// retries with Authorization: Payment, and returns the safety-check JSON.
const res = await mppx.fetch('https://www.oracleinsight.xyz/api/v1/safety/pre-trade?asset=ETH&chainId=1&action=swap&tradeAmountUsd=1000');
const check = await res.json();
console.log(check.verdict, check.recommendedMaxPositionUsd);MPP is deployment-opt-in. The REST endpoint settles only after a successful check. The MPP MCP pilot is at /api/mcp/mpp and supports only pre_trade_safety_check; the full catalog at /api/mcp keeps its x402 and API-key payment paths.
05 — Python
The official Python SDK intercepts the 402 inside an httpx async transport, so your LangChain or custom agent loop stays untouched.
# pip install "x402[httpx,evm]"
import asyncio, os
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
URL = "https://www.oracleinsight.xyz/api/v1/safety/pre-trade?asset=ETH&chainId=1&action=swap&tradeAmountUsd=1000"
async def main():
account = Account.from_key(os.environ["EVM_PRIVATE_KEY"])
client = x402Client()
register_exact_evm_client(client, EthAccountSigner(account))
async with x402HttpxClient(client) as http:
response = await http.get(URL, headers={"X-Insight-Entry-Source": "docs"})
await response.aread()
print(response.text) # verdict JSON, payment settled automatically
asyncio.run(main())06 — MCP tools/call
The Model Context Protocol endpoint at https://www.oracleinsight.xyz/api/mcp lets any agent browse the 40+-tool catalog for free (initialize, tools/list, ping). Unauthenticated tools/call is priced by the tool's metering class and settles through the same x402 rail. With an X-API-Key, calls draw from the credit wallet instead. New accounts receive a one-time 100-credit grant after email verification, so an agent can start without a wallet. The MPP pilot at https://www.oracleinsight.xyz/api/mcp/mppaccepts only pre_trade_safety_check; its challenge is bound to the tool arguments and settles only after success.
// Any x402 v2 client works; the only difference from the REST example
// is the JSON-RPC POST body. tools/list and initialize stay free.
const rpcBody = {
jsonrpc: '2.0',
id: 1,
method: 'tools/call',
params: {
name: 'pre_trade_safety_check',
arguments: { asset: 'ETH', chainId: 1, action: 'swap', tradeAmountUsd: 1000 },
},
};
const res = await fetchWithPay('https://www.oracleinsight.xyz/api/mcp', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json, text/event-stream',
'X-Insight-Entry-Source': 'docs',
},
body: JSON.stringify(rpcBody),
});
// The settle receipt arrives in the payment-response header:
// decode it and read .transaction for the matching chain explorer link.// npm i @modelcontextprotocol/sdk mppx viem
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
import { evm } from 'mppx/client';
import { McpClient } from 'mppx/mcp/client';
import { privateKeyToAccount } from 'viem/accounts';
const client = new Client({ name: 'insight-agent', version: '1.0.0' });
await client.connect(
new StreamableHTTPClientTransport(new URL('https://www.oracleinsight.xyz/api/mcp/mpp')),
);
const paidClient = McpClient.wrap(client, {
methods: [
evm.charge({
account: privateKeyToAccount(process.env.EVM_PRIVATE_KEY!),
networks: [8453],
currencies: ['0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'],
maxAmount: '0.02',
}),
],
});
const result = await paidClient.callTool({
name: 'pre_trade_safety_check',
arguments: { asset: 'ETH', chainId: 1, action: 'swap', tradeAmountUsd: 1000 },
});
console.log(result.content, result.receipt);| Class | Atomic units | USDC | Typical tools |
|---|---|---|---|
| C1 | 2000 | $0.002 | Lightweight reads (most catalog tools) |
| C2 | 4000 | $0.004 | Standard analysis tools |
| C3 | 20000 | $0.02 | Pre-trade safety check |
| C4 | 40000 | $0.04 | Heaviest composite tools |
07 — Verify what you paid for
The product is the answer, not the outcome: a BLOCK is a fully computed check and is charged like any other verdict. What you get back carries a verifiable EIP-712 attestation, so the receipt itself proves which oracle keys, quorum, and independence gates produced it. Key response fields: verdict, staleDataRisk, consensusPrice, maxDeviationPct, participantCount, manipulationRiskScore, crossProviderAgreement, recommendedMaxPositionUsd.
# 1. Verify a returned attestation receipt online (keyless, free):
curl -X POST https://www.oracleinsight.xyz/api/v1/safety/attestation/verify \
-H "Content-Type: application/json" --data @receipt.json
# 2. Or verify fully offline - recomputes the EIP-712 hash locally,
# no API key, no database, no dependency on Insight being online:
npm install verify-insight-receipt08 — Guard family quickstarts
Every guard family below is a x402 v2 resource: call it without credentials, receive the HTTP 402 quote, pay, and retry — the same three steps as the pre-trade example in section 02, only the path and parameters differ. Each row also names the MCP tool equivalent, so an agent can pick either surface. All guard decisions are C3 ($0.02 per complete decision); the two 24h products are flat-priced.
| Family | Endpoint / MCP tool | What it decides | Price |
|---|---|---|---|
Execution preflightGET /api/v1/safety/preflightasset=MON&chainId=143&action=swap&tradeAmountUsd=1000&destinationAsset=USDC | execution_preflight | ALLOW / CAUTION / BLOCK data-sufficiency for one declared action | $0.02 (C3) |
Base Lending GuardGET /api/v1/safety/base-lending-guardprotocolId=aave-v3-base&action=borrow&collateralSymbol=WETH&loanSymbol=USDC&collateralValueUsd=10000&debtValueUsd=4000 | base_lending_guard · base_lending_guard_exact_call | Aave V3, Morpho Blue, Compound V3, Moonwell on Base | $0.02 (C3) |
Base Perp GuardGET /api/v1/safety/base-perp-guardprotocolId=synthetix-perps-v3-base&action=open_long&assetSymbol=ETH&marginAssetSymbol=USDC&sizeUsd=25000&marginValueUsd=5000 | base_perp_guard · base_perp_guard_exact_call | Synthetix Perps V3 open: oracle integrity + leverage caps | $0.02 (C3) |
Hyperliquid Perp GuardGET /api/v1/safety/hyperliquid-perp-guardprotocolId=hyperliquid-perps-mainnet&action=open_long&assetSymbol=BTC&marginAssetSymbol=USDC&sizeUsd=25000&marginValueUsd=5000 | hyperliquid_perp_guard · hyperliquid_perp_guard_exact_call | HyperCore order intent: oracle integrity + leverage vs margin | $0.02 (C3) |
Solana Perp GuardGET /api/v1/safety/solana-perp-guardprotocolId=drift-v2-mainnet&action=open_long&assetSymbol=SOL&marginAssetSymbol=USDC&sizeUsd=5000&marginValueUsd=500 | solana_perp_guard | Drift v2 open: oracle integrity + leverage + on-chain venue evidence | $0.02 (C3) |
Monad Lending GuardGET /api/v1/safety/monad-lending-guardprotocolId=aave-v3-monad&action=borrow&collateralSymbol=WETH&loanSymbol=USDC&collateralValueUsd=10000&debtValueUsd=4000 | monad_lending_guard · monad_lending_guard_exact_call | Aave V3 Monad, exact Morpho Blue Monad markets | $0.02 (C3) |
Multichain EVM Lending GuardGET /api/v1/safety/multichain-evm-lending-guardchainId=42161&protocolId=aave-v3-arbitrum&action=borrow&collateralSymbol=WETH&loanSymbol=USDC&collateralValueUsd=10000&debtValueUsd=4000 | multichain_evm_lending_guard · _exact_call | Aave, Venus, Lista, Compound, Dolomite, Euler v2, Fluid T1 | $0.02 (C3) |
Solana Lending GuardPOST /api/v1/safety/solana-lending-guard(POST body: exact unsigned Kamino / Marginfi / Jupiter Earn / Save instruction) | solana_lending_guard · loopscale_vault_deposit | One direct Solana deposit instruction, simulated before attestation | $0.02 (C3) |
Solana Swap GuardPOST /api/v1/safety/solana-swap-guard(POST body: exact unsigned Orca Whirlpool USDC/USDT swap message) | solana_swap_guard · settle/verify_solana_swap_guard_settlement | One reviewed Orca Whirlpool USDC/USDT swap, priced against oracle consensus | $0.02 (C3); settlement C4 |
Verified Swap IntentGET /api/v1/safety/swap-intentsourceAsset=ETH&destinationAsset=USDC&subjectChainId=1&settlementChainId=1&declaredNotionalUsd=1000 | agent_begin_trade · verify_execution_pair | Two schema-v3 gates + one execution-receipt credit per swap | $0.02 (C3) |
Oracle Watch Window (24h)POST /api/v1/safety/oracle-watch-window(POST body: {"symbol":"BTC","chain":"hyperevm"}; returns a one-time window token) | REST-first (token-authed in-window polls) | 24h of continuous halt/proceed signals for one position | $0.50 per window |
Position Lifecycle Bundle (24h)POST /api/v1/safety/position-lifecycle(POST body: {"symbol":"BTC","chain":"hyperevm"}; returns a one-time lifecycle token) | REST-first (bundled calls are token-authed) | Embedded window + 4 guard assessments + 1 attested receipt | $0.55 per lifecycle |
POST exact-call guards and the two 24h products take a JSON body instead of query params; the Solana guards simulate the exact unsigned message before returning a decision. Every guard is read-only: it never signs, broadcasts, or authorizes a transaction.
# Every guard follows the same three steps as pre-trade:
# 1) call without credentials -> HTTP 402 quote
# 2) sign the quoted option with your x402 client
# 3) retry -> verdict JSON + PAYMENT-RESPONSE settlement header
# Example: Hyperliquid Perp Guard preview (GET, $0.02 / C3)
curl -sD - -o /dev/null -H 'X-Insight-Entry-Source: docs' \
"https://www.oracleinsight.xyz/api/v1/safety/hyperliquid-perp-guard?protocolId=hyperliquid-perps-mainnet&action=open_long&assetSymbol=BTC&marginAssetSymbol=USDC&sizeUsd=25000&marginValueUsd=5000" \
| grep -i '^payment-required' | cut -d' ' -f2- | base64 --decode | jq
# Example: buy a 24h Position Lifecycle Bundle (POST, $0.55 flat)
curl -sD - -o /dev/null -X POST \
"https://www.oracleinsight.xyz/api/v1/safety/position-lifecycle" \
-H 'Content-Type: application/json' \
--data '{"symbol":"BTC","chain":"hyperevm"}' \
| grep -i '^payment-required' | cut -d' ' -f2- | base64 --decode | jq
# The purchase returns a one-time lifecycle token; the bundled window polls,
# guard assessments, and receipt are then token-authenticated, never re-charged.09 — Reference
Four parameters are required; the rest tune the check. Machine-readable discovery lives at the site root for agents that prefer manifests over HTML.
| Parameter | Required | Detail |
|---|---|---|
| asset | Yes | Asset symbol, e.g. ETH, BTC, USDC |
| chainId | Yes | Chain ID, e.g. 1=Ethereum, 8453=Base, 0=chain-agnostic |
| action | Yes | swap | borrow | lend | liquidate | repay |
| tradeAmountUsd | Yes | Trade size in USD, e.g. 1000 |
| targetProviders | No | Comma-separated oracle providers to restrict the check to |
| protocolId | No | Lending protocol to evaluate against, e.g. aave-v3-ethereum |
| schemaVersion | No | Attestation schema: 1 (default), 2 (quorum gate), 3 (adds independence gate) |