{"uid":"cap_BjIkmfecpuB3ynLaXChb-","slug":"crypto-microdata-for-agents-x402-pay-gateway-3e5844e6","name":"Crypto Microdata for Agents (x402) — /pay Gateway","description":"Pay-per-call crypto microdata for trading/onchain AI agents via x402 (USDC on Base): Base gas, token risk, balances, multi-venue prices, Hyperliquid book/funding, kimchi premium. No API keys.","url":"https://kr-x402-mvp.kgy5612.workers.dev/pay?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","properties":{"echo":{"type":"string","examples":["my-agent-1"],"maxLength":64,"description":"Optional string echoed back (correlate your test call)"},"testRunId":{"type":"string","examples":["run-001"],"maxLength":100,"description":"Optional caller-supplied correlation ID for a bounded validation run (echoed back)"}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"t":"2026-10-28T14:00:00Z","ok":true,"next":["/crypto/simulate","/crypto/ens","/crypto/liquidations?coin=BTC","/crypto/base-gas"],"receiptId":"rcpt_0b9f6c1e2a7d4c55","testRunId":"run-001","nextAction":"call_paid_data","paymentVerified":true}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_AvVbRoedVDae_8yavNexO","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Pay-per-call gateway endpoint that accepts x402 micropayments (USDC on Base) and returns routing metadata and receipt for subsequent crypto data calls","exampleAgentPrompt":"Pay for a crypto microdata call using x402 with my USDC on Base and tag it with correlation ID 'run-001' so I can verify the payment went through before fetching Base gas prices.","exampleUseCases":[{"title":"Validate payment before trading data fetch","prompt":"I need to verify my USDC micropayment went through on Base before my agent pulls live Hyperliquid funding rates — can you hit the x402 pay gateway with test run ID 'hyperliq-run-42' and confirm the receipt?"},{"title":"Agent self-check for onchain payment flow","prompt":"Before my trading bot starts its session, have it pay the x402 gateway with correlation tag 'bot-session-001' and confirm paymentVerified is true, then tell me which crypto data endpoints it should call next."},{"title":"Integration test of x402 micropayment pipeline","prompt":"Run a test call against the x402 pay endpoint with echo string 'smoke-test-1' and testRunId 'ci-run-007' so I can confirm the payment pipeline is working end-to-end before deploying my onchain agent."}],"resultDescription":"Returns a JSON object with: timestamp (t), ok status, paymentVerified boolean, receiptId for the micropayment, echoed testRunId, nextAction string ('call_paid_data'), and an array of suggested next endpoint paths (e.g. /crypto/base-gas, /crypto/liquidations).","failureModes":["Payment not received or insufficient USDC balance — returns 402 Payment Required with payment instructions","Invalid x402 payment header format — returns 400 Bad Request","echo or testRunId exceeds max length (64 or 100 chars) — schema validation error","Network or Cloudflare Worker timeout — returns 5xx with no receipt","Payment double-spend or replay detected — payment rejected"],"whenToPreferThis":"Use this endpoint as the mandatory first step when integrating with the x402 crypto microdata suite — it handles payment verification and returns routing metadata so your agent knows which data endpoints to call next. Prefer it over API-key-based crypto data services when you want keyless, pay-per-call access with USDC on Base, or when building onchain agents that need to self-fund their own data access programmatically.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:42:23.949Z","isFirstParty":false,"canonicalSlug":"crypto-microdata-for-agents-x402-pay-gateway-3e5844e6"}