Pre-trade context bundle for autonomous crypto agents
x402-gateway-production-1f21.up.railway.app/payai/agent/pretrade
Pre-trade context bundle for autonomous crypto agents: wallet balance, allowance, gas, realtime price, 24h statistics and best bid/ask. Call immediately before every automated trade, swap or payment and refresh again before the next execution. Data only.
POST
https://x402-gateway-production-1f21.up.railway.app/payai/agent/pretradeUptime0.0% of 1 check in 30 days
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://x402-gateway-production-1f21.up.railway.app/payai/agent/pretrade", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"address":"0x0000000000000000000000000000000000000000","network":"base","spender":"0x0000000000000000000000000000000000000000","product_id":"BTC-USD","token_contract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}),
});
console.log(await res.json());Example input
{
"address": "0x0000000000000000000000000000000000000000",
"network": "base",
"spender": "0x0000000000000000000000000000000000000000",
"product_id": "BTC-USD",
"token_contract": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}More from Industrial Platform payai
- x402-gateway-production-1f21.up.railway.app/payai/agent/transaction-watchTransaction confirmation watch for autonomous agents. Poll about every 15 seconds while pending, reusing the returned next request/state, and stop automatically once confirmed or reverted.0.003
- x402-gateway-production-1f21.up.railway.app/payai/agent/treasury-snapshotRecurring crypto treasury snapshot for autonomous agents: balances, gas and recent USDC/ERC-20 activity with cursor/state and a ready next request. Designed for scheduled treasury/accounting loops; repeat about every five minutes while active.0.01
- x402-gateway-production-1f21.up.railway.app/payai/agent/wallet-monitorRecurring wallet monitor for crypto agents. Check balances and new USDC/ERC-20 transfers since the prior cursor, then return a ready next request. Designed to be called about every 60 seconds for deposit detection, payment monitoring and treasury alerts.0.005
- x402-gateway-production-1f21.up.railway.app/payai/chain/transaction-statusCheck whether a transaction is pending, confirmed or reverted on Base or Ethereum. Designed for polling: retry about every 15 seconds while pending and stop once confirmed or reverted.0.001
- x402-gateway-production-1f21.up.railway.app/payai/changeRecurring webpage monitoring for price, inventory, availability, policy, documentation and competitor changes. Returns current_hash plus a ready next-check contract for repeated polling.0.001
- x402-gateway-production-1f21.up.railway.app/payai/crypto/bookRealtime crypto top-of-book data for autonomous execution: best bid, best ask, sizes and sequence. Designed for repeated pre-execution polling; refresh about every 10 seconds during active trading.0.001
- x402-gateway-production-1f21.up.railway.app/payai/crypto/candlesCrypto OHLCV candles for autonomous trading and indicator pipelines. Supports 1m–1d bars and is designed for recurring refresh; poll again when the selected candle interval advances.0.005
- x402-gateway-production-1f21.up.railway.app/payai/crypto/priceRealtime crypto price from Coinbase Exchange for trading agents and market monitors. Designed for repeated polling; refresh about every 15 seconds during active trading or alerting workflows.0.001
- x402-gateway-production-1f21.up.railway.app/payai/crypto/snapshotOne-call realtime crypto market snapshot for trading agents: price, bid/ask, 24h stats, top-of-book, recent trades and OHLCV candles. Designed for repeated market polling; refresh about every 30 seconds for active trading or monitoring workflows.0.008
