x402 Chain API

The chain API from x402 — 8 operation(s) for chain.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 8

GET /v1/chain/block Get the latest Base block with its age in seconds, base fee and gas used. #
GET /v1/chain/gas Get the current Base gas price and the ETH cost of an ETH, ERC-20 or x402 USDC… #
GET /v1/chain/balance Get ETH, USDC and up to ten ERC-20 balances of one address in a single call… #
GET /v1/chain/token Get an ERC-20's name, symbol, decimals, total supply, holder count and USD rate… #
GET /v1/chain/allowance Get an ERC-20 allowance with the owner's balance and a sufficiency verdict for… #
GET /v1/chain/ens ENS name resolution in both directions: an .eth name to its address, or an… #
GET /v1/chain/abi The verified ABI of a smart contract on any EVM chain from Sourcify: function… #
GET /v1/chain/address See the USDC an address received and sent on Base, with x402 settlements… #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/x-402-online:x-402-online-chain-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

x-402-online-chain-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: x402-farm — pay-per-call data & security tools for AI…
  version: 1.0.0
  description: Pay-per-call APIs for AI agents — x402 protocol, USDC on Base, no account needed.
  x-nexora:
    what: One task, one payment, several capabilities, a verified result. Send an objective and a budget; the service picks the capabilities, runs them in order, checks the result and returns it with the evidence.
    when: 'When you want an answer rather than a raw API response: read a page and answer a question about it, search recent news and read a source, or just search. Not when you only need a single primitive you already know how to call.'
    returns: An answer, the sources it came from, the extracts that back it, the list of checks that were run, the real cost and the latency. If the source is blocked or the model cannot answer from it, you get an explicit failure and no answer, never an invented one.
    cost: 0.012800 USDC per task, fixed, whatever the number of internal steps. POST /v1/agent/quote is free and returns the plan, the price and the limits before you pay anything.
    payment: 'x402: call it, get HTTP 402 with the payment requirements, sign, retry. USDC on Base or Solana. No account, no API key.'
    slogan: ONE TASK -> ONE PAYMENT -> MULTIPLE CAPABILITIES -> VERIFIED RESULT
    workflow: DISCOVER -> QUOTE -> PAY -> EXECUTE -> VERIFY -> RESULT
    start_here:
    - 'POST /v1/agent/task — la capacité principale : un objectif, un paiement, un résultat vérifié'
    - 'POST /v1/agent/quote — gratuit : le plan, le prix et les limites AVANT de payer'
    - 'GET /v1/agent/capabilities — gratuit : ce qui est réellement disponible, et ce qui est dégradé'
  x-guidance: 'Each route is a named job at a fixed USDC price (see per-operation x-payment-info). Unpaid requests return HTTP 402 with x402 payment instructions. Highest-value jobs: GET /v1/crypto/security (honeypot / rug-pull verdict OK/CAUTION/HIGH_RISK/AVOID before trading, 8 chains), POST /v1/extract (residential-IP web scraping — reaches sites blocking datacenter/cloud IPs, returns clean markdown), GET /v1/fr/kyb (company KYB / SIREN), GET /v1/crypto/token (live token price & liquidity), and GET /v1/proxy/1gb|5gb|20gb (buy a RESIDENTIAL PROXY by the GB — route your HTTP/HTTPS traffic through a real residential IP that datacenter proxies can''t match; returns a ready-to-use proxy key, from $2/GB, cheaper than Browserbase/Bright Data). Pay per call, no subscription, no API key.'
  contact:
    email: laurenthalbrun@gmail.com
servers:
- url: https://x-402.online
tags:
- name: Chain
paths:
  /v1/chain/block:
    get:
      operationId: getChainBlock
      tags:
      - Chain
      summary: Get the latest Base block with its age in seconds, base fee and gas used.
      security: []
      description: 'Get the latest Base block with its age in seconds, base fee and gas used. The latest Base block: number, hash, timestamp, age in seconds (so you know the node is not lagging), base fee, gas used. Public RPC, no key. Query: none. — Price: $0.005000 per call via x402 (USDC on Base or Solana). Unpaid requests get HTTP 402 with the exact amount in the challenge.'
      parameters: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  chain:
                    type: string
                  block_number:
                    type: integer
                  timestamp_iso:
                    type: string
                  age_seconds:
                    type: integer
                  base_fee_gwei:
                    type: number
                  transactions:
                    type: integer
              example:
                chain: base
                block_number: 40000000
                timestamp_iso: '2026-09-23T12:00:00.000Z'
                age_seconds: 2
                base_fee_gwei: 0.0051
                transactions: 180
        '402':
          description: Payment Required
      x-payment-info:
        protocols:
        - x402:
            networks:
            - eip155:8453
            - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
            asset: USDC
            scheme: exact
            amountAtomic: '5000'
        price:
          mode: fixed
          currency: USD
          amount: '0.005000'
  /v1/chain/gas:
    get:
      operationId: getChainGas
      tags:
      - Chain
      summary: Get the current Base gas price and the ETH cost of an ETH, ERC-20 or x402 USDC…
      security: []
      description: 'Get the current Base gas price and the ETH cost of an ETH, ERC-20 or x402 USDC transfer at that price. Current Base gas: gas price, base fee, priority fee, and the ETH cost of an ETH transfer, an ERC-20 transfer and an x402 USDC settlement at that price. Query: none. — Price: $0.005000 per call via x402 (USDC on Base or Solana). Unpaid requests get HTTP 402 with the exact amount in the challenge.'
      parameters: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  gas_price_gwei:
                    type: number
                  base_fee_gwei:
                    type: number
                  estimates:
                    type: object
                    properties:
                      eth_transfer:
                        type: object
                        properties:
                          gas:
                            type: integer
                          eth:
                            type: string
                      erc20_transfer:
                        type: object
                        properties:
                          gas:
                            type: integer
                          eth:
                            type: string
              example:
                gas_price_gwei: 0.0062
                base_fee_gwei: 0.0051
                estimates:
                  eth_transfer:
                    gas: 21000
                    eth: '0.00000013'
                  erc20_transfer:
                    gas: 65000
                    eth: '0.0000004'
        '402':
          description: Payment Required
      x-payment-info:
        protocols:
        - x402:
            networks:
            - eip155:8453
            - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
            asset: USDC
            scheme: exact
            amountAtomic: '5000'
        price:
          mode: fixed
          currency: USD
          amount: '0.005000'
  /v1/chain/balance:
    get:
      operationId: getChainBalance
      tags:
      - Chain
      summary: Get ETH, USDC and up to ten ERC-20 balances of one address in a single call…
      security: []
      description: 'Get ETH, USDC and up to ten ERC-20 balances of one address in a single call, human-readable. ETH plus USDC plus up to ten ERC-20 balances of one address in a single call, decimals resolved, amounts human-readable. Base mainnet. Query: ?address=0x…&tokens=0x…,0x… — Price: $0.005000 per call via x402 (USDC on Base or Solana). Unpaid requests get HTTP 402 with the exact amount in the challenge.'
      parameters:
      - name: address
        in: query
        required: true
        schema:
          type: string
        example: '0x2c871C2b8876dc35e9E19646FDa5ABF1cd27735F'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  address:
                    type: string
                  native:
                    type: object
                    properties:
                      symbol:
                        type: string
                      amount:
                        type: string
                  tokens:
                    type: array
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                        decimals:
                          type: integer
                        amount:
                          type: string
              example:
                address: 0x…
                native:
                  symbol: ETH
                  amount: '0.0123'
                tokens:
                - symbol: USDC
                  decimals: 6
                  amount: '19.75'
        '402':
          description: Payment Required
      x-payment-info:
        protocols:
        - x402:
            networks:
            - eip155:8453
            - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
            asset: USDC
            scheme: exact
            amountAtomic: '5000'
        price:
          mode: fixed
          currency: USD
          amount: '0.005000'
  /v1/chain/token:
    get:
      operationId: getChainToken
      tags:
      - Chain
      summary: Get an ERC-20's name, symbol, decimals, total supply, holder count and USD rate…
      security: []
      description: 'Get an ERC-20''s name, symbol, decimals, total supply, holder count and USD rate in one call. An ERC-20 on Base in one call: name, symbol, decimals, total supply, USD price, liquidity and icon from DexScreener when the token trades. Query: ?address=0x… — Price: $0.005000 per call via x402 (USDC on Base or Solana). Unpaid requests get HTTP 402 with the exact amount in the challenge.'
      parameters:
      - name: address
        in: query
        required: true
        schema:
          type: string
        example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  symbol:
                    type: string
                  name:
                    type: string
                  decimals:
                    type: integer
                  total_supply:
                    type: object
                    properties:
                      amount:
                        type: string
                  holders:
                    type: integer
              example:
                symbol: USDC
                name: USD Coin
                decimals: 6
                total_supply:
                  amount: '4200000000'
                holders: 1200000
        '402':
          description: Payment Required
      x-payment-info:
        protocols:
        - x402:
            networks:
            - eip155:8453
            - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
            asset: USDC
            scheme: exact
            amountAtomic: '5000'
        price:
          mode: fixed
          currency: USD
          amount: '0.005000'
  /v1/chain/allowance:
    get:
      operationId: getChainAllowance
      tags:
      - Chain
      summary: Get an ERC-20 allowance with the owner's balance and a sufficiency verdict for…
      security: []
      description: 'Get an ERC-20 allowance with the owner''s balance and a sufficiency verdict for the amount you plan to pull. ERC-20 allowance of a spender on an owner (USDC by default), with the owner''s balance and, if you pass ?amount=, a verdict: is the allowance sufficient, is the balance sufficient. Base mainnet. Query: ?owner=0x…&spender=0x…&token=0x…&amount=12.5 — Price: $0.005000 per call via x402 (USDC on Base or Solana). Unpaid requests get HTTP 402 with the exact amount in the challenge.'
      parameters:
      - name: owner
        in: query
        required: true
        schema:
          type: string
        example: '0x2c871C2b8876dc35e9E19646FDa5ABF1cd27735F'
      - name: spender
        in: query
        required: true
        schema:
          type: string
        example: '0x68214ff5c44f38d19ed886e8d59aadb8cab2ce22'
      - name: amount
        in: query
        required: false
        schema:
          type: string
        example: '5'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  symbol:
                    type: string
                  allowance:
                    type: object
                    properties:
                      amount:
                        type: string
                      unlimited:
                        type: boolean
                  owner_balance:
                    type: object
                    properties:
                      amount:
                        type: string
                  verdict:
                    type: object
                    properties:
                      allowance_sufficient:
                        type: boolean
                      balance_sufficient:
                        type: boolean
              example:
                symbol: USDC
                allowance:
                  amount: '100'
                  unlimited: false
                owner_balance:
                  amount: '19.75'
                verdict:
                  allowance_sufficient: true
                  balance_sufficient: true
        '402':
          description: Payment Required
      x-payment-info:
        protocols:
        - x402:
            networks:
            - eip155:8453
            - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
            asset: USDC
            scheme: exact
            amountAtomic: '5000'
        price:
          mode: fixed
          currency: USD
          amount: '0.005000'
  /v1/chain/ens:
    get:
      operationId: getChainEns
      tags:
      - Chain
      summary: 'ENS name resolution in both directions: an .eth name to its address, or an…'
      security: []
      description: 'ENS name resolution in both directions: an .eth name to its address, or an address to its primary ENS name, with the avatar when set. Query: ?name=vitalik.eth or ?address=0xd8dA… — Price: $0.005000 per call via x402 (USDC on Base or Solana). Unpaid requests get HTTP 402 with the exact amount in the challenge.'
      parameters:
      - name: name
        in: query
        required: true
        schema:
          type: string
        example: vitalik.eth
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  address:
                    type: string
                  name:
                    type: string
                  resolved:
                    type: boolean
              example:
                address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
                name: vitalik.eth
                resolved: true
        '402':
          description: Payment Required
      x-payment-info:
        protocols:
        - x402:
            networks:
            - eip155:8453
            - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
            asset: USDC
            scheme: exact
            amountAtomic: '5000'
        price:
          mode: fixed
          currency: USD
          amount: '0.005000'
  /v1/chain/abi:
    get:
      operationId: getChainAbi
      tags:
      - Chain
      summary: 'The verified ABI of a smart contract on any EVM chain from Sourcify: function…'
      security: []
      description: 'The verified ABI of a smart contract on any EVM chain from Sourcify: function signatures, event names, contract name, compiler version and proxy implementations, plus the full ABI JSON ready for a client. Query: ?address=0x8335…&chain_id=8453 — Price: $0.005000 per call via x402 (USDC on Base or Solana). Unpaid requests get HTTP 402 with the exact amount in the challenge.'
      parameters:
      - name: address
        in: query
        required: false
        schema:
          type: string
        example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
      - name: chain_id
        in: query
        required: false
        schema:
          type: integer
        example: 8453
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  verified:
                    type: boolean
                  functions:
                    type: array
                    items:
                      type: string
                  proxy:
                    type: object
                    properties:
                      type:
                        type: string
                  abi:
                    type: array
              example:
                verified: true
                functions:
                - upgradeTo(address)
                proxy:
                  type: EIP1967Proxy
                abi: []
        '402':
          description: Payment Required
      x-payment-info:
        protocols:
        - x402:
            networks:
            - eip155:8453
            - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
            asset: USDC
            scheme: exact
            amountAtomic: '5000'
        price:
          mode: fixed
          currency: USD
          amount: '0.005000'
  /v1/chain/address:
    get:
      operationId: getChainAddress
      tags:
      - Chain
      summary: See the USDC an address received and sent on Base, with x402 settlements…
      security: []
      description: 'See the USDC an address received and sent on Base, with x402 settlements identified. ERC-20 transfers of an address on Base, incoming and outgoing, with the x402 settlements identified by their EIP-3009 method. Totals, distinct senders, last settlement time. Default token is USDC. Data from the Coinbase CDP on-chain index, last 100 transfers within 60 days, truncation declared. Query: ?address=&token= — Price: $0.005000 per call via x402 (USDC on Base or Solana). Unpaid requests get HTTP 402 with the exact amount in the challenge.'
      parameters:
      - name: address
        in: query
        required: true
        schema:
          type: string
        example: '0x2c871C2b8876dc35e9E19646FDa5ABF1cd27735F'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  incoming:
                    type: object
                    properties:
                      count:
                        type: integer
                      total:
                        type: number
                      distinct_senders:
                        type: integer
                      x402_settlements:
                        type: integer
                      last_at:
                        type: string
              example:
                incoming:
                  count: 50
                  total: 0.3
                  distinct_senders: 4
                  x402_settlements: 49
                  last_at: …
        '402':
          description: Payment Required
      x-payment-info:
        protocols:
        - x402:
            networks:
            - eip155:8453
            - solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
            asset: USDC
            scheme: exact
            amountAtomic: '5000'
        price:
          mode: fixed
          currency: USD
          amount: '0.005000'