API Documentation

Complete reference for all PayToll API endpoints. Start with free-tier calls, then use x402 payment with USDC on Base when paid access is required.

Getting Started

  1. 1Make a request to a free-tier endpoint (for example/v1/crypto/price). You'll receive a normal response plus free-tier usage headers.
  2. 2Free-tier defaults are 50 calls per IP per UTC day. Some expensive endpoints are paid immediately.
  3. 3When paid access is required, you'll receive402 Payment Required. Retry with theX-Paymentheader containing the payment proof signed with your wallet.

aave-best-borrow

1.0.0

Find lowest Aave V3 borrow APR across all chains

$0.01
POST/v1/aave/best-borrow

Parameters

NameTypeDescription
assetrequiredstring

Asset symbol (e.g., USDC, ETH, WBTC, DAI)

chainIdsarray

Optional: specific chain IDs to query

minLiquiditynumber

Optional: minimum available liquidity in USD

Range: 0 -

Example Request

curl -X POST https://api.paytoll.io/v1/aave/best-borrow \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "asset": "example",
  "chainIds": [],
  "minLiquidity": 1
}'

aave-best-yield

1.0.0

Find best Aave V3 supply APY across all chains

$0.01
POST/v1/aave/best-yield

Parameters

NameTypeDescription
assetrequiredstring

Asset symbol (e.g., USDC, ETH, WBTC, DAI)

chainIdsarray

Optional: specific chain IDs to query. Default: all major chains

minLiquiditynumber

Optional: minimum available liquidity in USD to consider

Range: 0 -

Example Request

curl -X POST https://api.paytoll.io/v1/aave/best-yield \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "asset": "example",
  "chainIds": [],
  "minLiquidity": 1
}'

aave-borrow

1.0.0

Build an Aave V3 borrow transaction

$0.01
POST/v1/aave/borrow

Parameters

NameTypeDescription
userAddressrequiredstring

Wallet address that will sign the transaction

tokenAddressrequiredstring

ERC20 token contract address to borrow

amountrequiredstring

Amount to borrow (human-readable, e.g. "100.5")

chainIdrequiredintegerenum: 1 | 137 | 42161 | 10 | 8453 | 43114

Chain ID (1=Ethereum, 137=Polygon, 42161=Arbitrum, 10=Optimism, 8453=Base, 43114=Avalanche)

marketAddressstring

Optional: Aave pool address. Uses default if not provided.

Example Request

curl -X POST https://api.paytoll.io/v1/aave/borrow \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "userAddress": "example",
  "tokenAddress": "example",
  "amount": "example",
  "chainId": 1,
  "marketAddress": "example"
}'

aave-health-factor

1.0.0

Get health factor and liquidation risk for an Aave position

$0.005
POST/v1/aave/health-factor

Parameters

NameTypeDescription
userAddressrequiredstring

Ethereum wallet address

chainIdrequiredintegerenum: 1 | 137 | 42161 | 10 | 8453 | 43114

Chain ID (1=Ethereum, 137=Polygon, 42161=Arbitrum, 10=Optimism, 8453=Base, 43114=Avalanche)

marketAddressstring

Optional: Aave pool address. Uses default if not provided.

Example Request

curl -X POST https://api.paytoll.io/v1/aave/health-factor \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "userAddress": "example",
  "chainId": 1,
  "marketAddress": "example"
}'

aave-markets

1.0.0

Get overview of all Aave V3 markets with TVL and rates

$0.005
POST/v1/aave/markets

Parameters

NameTypeDescription
chainIdsarray

Optional: specific chain IDs. Default: all major chains.

topAssetsCountinteger

Number of top assets to include per market (default: 5)

Range: 1 - 20

Example Request

curl -X POST https://api.paytoll.io/v1/aave/markets \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "chainIds": [],
  "topAssetsCount": 1
}'

aave-repay

1.0.0

Build an Aave V3 repay transaction

$0.01
POST/v1/aave/repay

Parameters

NameTypeDescription
userAddressrequiredstring

Wallet address that will sign the transaction

tokenAddressrequiredstring

ERC20 token contract address to repay

amountstring

Amount to repay (human-readable). Required unless max is true.

maxboolean

If true, repay the entire debt position. Overrides amount.

chainIdrequiredintegerenum: 1 | 137 | 42161 | 10 | 8453 | 43114

Chain ID (1=Ethereum, 137=Polygon, 42161=Arbitrum, 10=Optimism, 8453=Base, 43114=Avalanche)

marketAddressstring

Optional: Aave pool address. Uses default if not provided.

Example Request

curl -X POST https://api.paytoll.io/v1/aave/repay \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "userAddress": "example",
  "tokenAddress": "example",
  "amount": "example",
  "max": true,
  "chainId": 1,
  "marketAddress": "example"
}'

aave-supply

1.0.0

Build an Aave V3 supply (deposit) transaction

$0.01
POST/v1/aave/supply

Parameters

NameTypeDescription
userAddressrequiredstring

Wallet address that will sign the transaction

tokenAddressrequiredstring

ERC20 token contract address to supply

amountrequiredstring

Amount to supply (human-readable, e.g. "100.5")

chainIdrequiredintegerenum: 1 | 137 | 42161 | 10 | 8453 | 43114

Chain ID (1=Ethereum, 137=Polygon, 42161=Arbitrum, 10=Optimism, 8453=Base, 43114=Avalanche)

marketAddressstring

Optional: Aave pool address. Uses default if not provided.

Example Request

curl -X POST https://api.paytoll.io/v1/aave/supply \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "userAddress": "example",
  "tokenAddress": "example",
  "amount": "example",
  "chainId": 1,
  "marketAddress": "example"
}'

aave-user-positions

1.0.0

Get all Aave V3 positions for a wallet address

$0.01
POST/v1/aave/user-positions

Parameters

NameTypeDescription
userAddressrequiredstring

Ethereum wallet address

chainIdsarray

Optional: specific chain IDs to query

Example Request

curl -X POST https://api.paytoll.io/v1/aave/user-positions \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "userAddress": "example",
  "chainIds": []
}'

aave-withdraw

1.0.0

Build an Aave V3 withdraw transaction

$0.01
POST/v1/aave/withdraw

Parameters

NameTypeDescription
userAddressrequiredstring

Wallet address that will sign the transaction

tokenAddressrequiredstring

ERC20 token contract address to withdraw

amountstring

Amount to withdraw (human-readable). Required unless max is true.

maxboolean

If true, withdraw the entire supply position. Overrides amount.

chainIdrequiredintegerenum: 1 | 137 | 42161 | 10 | 8453 | 43114

Chain ID (1=Ethereum, 137=Polygon, 42161=Arbitrum, 10=Optimism, 8453=Base, 43114=Avalanche)

marketAddressstring

Optional: Aave pool address. Uses default if not provided.

Example Request

curl -X POST https://api.paytoll.io/v1/aave/withdraw \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "userAddress": "example",
  "tokenAddress": "example",
  "amount": "example",
  "max": true,
  "chainId": 1,
  "marketAddress": "example"
}'

crypto-price

2.0.0

Get real-time crypto prices for any coin

$0.015
POST/v1/crypto/price

Parameters

NameTypeDescription
symbolrequiredstring

Crypto ticker (e.g., BTC, ETH) or CoinGecko ID (e.g., bitcoin, usd-coin). Any CoinGecko-listed coin is supported.

currencystringenum: usd | eur | gbp | jpy

Fiat currency for price

Default: "usd"

includeMarketDataboolean

Include 24h volume, market cap, etc.

Default: false

Example Request

curl -X POST https://api.paytoll.io/v1/crypto/price \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "symbol": "ETH",
  "currency": "usd",
  "includeMarketData": false
}'

ens-check

1.0.0

Check ENS name availability and registration price

Free
POST/v1/ens/check

Parameters

NameTypeDescription
namerequiredstring

ENS name to check (without .eth suffix, e.g. "myname")

Example Request

curl -X POST https://api.paytoll.io/v1/ens/check \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "name": "example"
}'

ens-commit

1.0.0

Build a commit transaction for ENS name registration (step 1 of 2)

Free
POST/v1/ens/commit

Parameters

NameTypeDescription
namerequiredstring

ENS name to register (without .eth suffix)

userAddressrequiredstring

Ethereum address that will own the name

durationinteger

Registration duration in seconds (default: 31536000 = 1 year)

Range: 2419200 -

secretstring

Optional 32-byte hex secret. Auto-generated if not provided.

reverseRecordboolean

Set this name as the primary ENS name for the owner address (default: false)

Example Request

curl -X POST https://api.paytoll.io/v1/ens/commit \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "name": "example",
  "userAddress": "example",
  "duration": 1,
  "secret": "example",
  "reverseRecord": true
}'

ens-lookup

1.0.0

Resolve ENS names to Ethereum addresses and perform reverse lookups

$0.001
POST/v1/crypto/ens

Parameters

NameTypeDescription
namestring

ENS name (e.g., vitalik.eth)

addressstring

Ethereum address for reverse lookup

resolveAvatarboolean

Resolve avatar image

Default: false

resolveTextarray

Text records to resolve

Example Request

curl -X POST https://api.paytoll.io/v1/crypto/ens \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "name": "example",
  "address": "0x...",
  "resolveAvatar": false,
  "resolveText": []
}'

ens-register

1.0.0

Build a register transaction for ENS name registration (step 2 of 2)

Free
POST/v1/ens/register

Parameters

NameTypeDescription
namerequiredstring

ENS name to register (without .eth suffix)

userAddressrequiredstring

Ethereum address that will own the name (must match commit step)

durationinteger

Registration duration in seconds (must match commit step, default: 31536000 = 1 year)

Range: 2419200 -

secretrequiredstring

The secret from the commit step

reverseRecordboolean

Set this name as the primary ENS name for the owner address (default: false, must match commit step)

Example Request

curl -X POST https://api.paytoll.io/v1/ens/register \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "name": "example",
  "userAddress": "example",
  "duration": 1,
  "secret": "example",
  "reverseRecord": true
}'

ens-renew

1.0.0

Build a renewal transaction for an existing ENS name

Free
POST/v1/ens/renew

Parameters

NameTypeDescription
namerequiredstring

ENS name to renew (without .eth suffix)

durationinteger

Renewal duration in seconds (default: 31536000 = 1 year)

Range: 2419200 -

Example Request

curl -X POST https://api.paytoll.io/v1/ens/renew \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "name": "example",
  "duration": 1
}'

llm-anthropic

1.0.0

Anthropic messages proxy — Claude 3/3.5 Haiku family

$0.01
POST/v1/ai/anthropic/chat

Parameters

NameTypeDescription
messagesrequiredarray

Conversation messages

modelstringenum: claude-3-5-haiku-20241022 | claude-3-haiku-20240307

Model to use (default: claude-3-haiku-20240307)

Default: "claude-3-haiku-20240307"

temperaturenumber

Sampling temperature (0-2)

Default: 0.7

Range: 0 - 2

max_tokensinteger

Maximum output tokens (1-4096)

Default: 1024

Range: 1 - 4096

Example Request

curl -X POST https://api.paytoll.io/v1/ai/anthropic/chat \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "messages": [],
  "model": "claude-3-haiku-20240307",
  "temperature": 0.7,
  "max_tokens": 1024
}'

llm-google

1.0.0

Google Gemini proxy — Gemini 2.0 Flash and Flash Lite

$0.01
POST/v1/ai/google/chat

Parameters

NameTypeDescription
messagesrequiredarray

Conversation messages

modelstringenum: gemini-2.0-flash | gemini-2.0-flash-lite

Model to use (default: gemini-2.0-flash-lite)

Default: "gemini-2.0-flash-lite"

temperaturenumber

Sampling temperature (0-2)

Default: 0.7

Range: 0 - 2

max_tokensinteger

Maximum output tokens (1-4096)

Default: 1024

Range: 1 - 4096

Example Request

curl -X POST https://api.paytoll.io/v1/ai/google/chat \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "messages": [],
  "model": "gemini-2.0-flash-lite",
  "temperature": 0.7,
  "max_tokens": 1024
}'

llm-openai

1.0.0

OpenAI chat completions proxy — GPT-4o mini and GPT-3.5 Turbo

$0.01
POST/v1/ai/openai/chat

Parameters

NameTypeDescription
messagesrequiredarray

Conversation messages

modelstringenum: gpt-4o-mini | gpt-3.5-turbo

Model to use (default: gpt-4o-mini)

Default: "gpt-4o-mini"

temperaturenumber

Sampling temperature (0-2)

Default: 0.7

Range: 0 - 2

max_tokensinteger

Maximum output tokens (1-4096)

Default: 1024

Range: 1 - 4096

Example Request

curl -X POST https://api.paytoll.io/v1/ai/openai/chat \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "messages": [],
  "model": "gpt-4o-mini",
  "temperature": 0.7,
  "max_tokens": 1024
}'

onchain-token-data

1.0.0

Get comprehensive on-chain token data (price, supply, FDV, market cap, top pools)

$0.015
POST/v1/crypto/onchain/token-data

Parameters

NameTypeDescription
networkrequiredstringenum: eth | base | polygon_pos | arbitrum | optimism | avalanche | bsc | solana | fantom | celo

Network ID (e.g., eth, base, polygon_pos, arbitrum, solana)

contractAddressrequiredstring

Token contract address on the specified network

Example Request

curl -X POST https://api.paytoll.io/v1/crypto/onchain/token-data \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "network": "example",
  "contractAddress": "example"
}'

onchain-token-price

1.0.0

Get on-chain token price by contract address and network (powered by GeckoTerminal)

$0.015
POST/v1/crypto/onchain/token-price

Parameters

NameTypeDescription
networkrequiredstringenum: eth | base | polygon_pos | arbitrum | optimism | avalanche | bsc | solana | fantom | celo

Network ID (e.g., eth, base, polygon_pos, arbitrum, solana)

contractAddressrequiredstring

Token contract address on the specified network

Example Request

curl -X POST https://api.paytoll.io/v1/crypto/onchain/token-price \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "network": "example",
  "contractAddress": "example"
}'

search-pools

1.0.0

Search liquidity pools by token name, symbol, or contract address across networks

$0.015
POST/v1/crypto/onchain/search-pools

Parameters

NameTypeDescription
queryrequiredstring

Search query — token name, symbol, or contract address (e.g., "PEPE", "WETH", "0x...")

Example Request

curl -X POST https://api.paytoll.io/v1/crypto/onchain/search-pools \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "query": "example"
}'

swap-build

1.0.0

Build a DEX swap transaction for signing via Li.Fi

$0.01
POST/v1/swap/build

Parameters

NameTypeDescription
userAddressrequiredstring

Wallet address that will sign the transaction

fromChainrequiredinteger

Source chain ID (e.g. 1=Ethereum, 8453=Base, 42161=Arbitrum)

toChaininteger

Destination chain ID (defaults to fromChain for same-chain swap)

fromTokenrequiredstring

Source token address or symbol (e.g. "ETH", "USDC", or contract address)

toTokenrequiredstring

Destination token address or symbol

amountrequiredstring

Amount to swap (human-readable, e.g. "1.5")

slippagenumber

Slippage tolerance in percent (default 0.5%)

Range: 0.01 - 50

Example Request

curl -X POST https://api.paytoll.io/v1/swap/build \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "userAddress": "example",
  "fromChain": 1,
  "toChain": 1,
  "fromToken": "example",
  "toToken": "example",
  "amount": "example",
  "slippage": 1
}'

swap-quote

1.0.0

Get a DEX swap price quote across chains via Li.Fi

$0.005
POST/v1/swap/quote

Parameters

NameTypeDescription
fromChainrequiredinteger

Source chain ID (e.g. 1=Ethereum, 8453=Base, 42161=Arbitrum)

toChaininteger

Destination chain ID (defaults to fromChain for same-chain swap)

fromTokenrequiredstring

Source token address or symbol (e.g. "ETH", "USDC", or contract address)

toTokenrequiredstring

Destination token address or symbol

amountrequiredstring

Amount to swap in human-readable form (e.g. "1.5")

slippagenumber

Slippage tolerance in percent (default 0.5%)

Range: 0.01 - 50

Example Request

curl -X POST https://api.paytoll.io/v1/swap/quote \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "fromChain": 1,
  "toChain": 1,
  "fromToken": "example",
  "toToken": "example",
  "amount": "example",
  "slippage": 1
}'

token-balance

1.0.0

Check wallet token balance on any supported chain

$0.005
POST/v1/crypto/token-balance

Parameters

NameTypeDescription
userAddressrequiredstring

Wallet address to check

chainIdrequiredintegerenum: 1 | 10 | 56 | 137 | 8453 | 42161 | 43114

Chain ID (1=Ethereum, 10=Optimism, 56=BSC, 137=Polygon, 8453=Base, 42161=Arbitrum, 43114=Avalanche)

tokenAddressstring

ERC20 token contract address. Omit for native token (ETH, MATIC, etc.).

Example Request

curl -X POST https://api.paytoll.io/v1/crypto/token-balance \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "userAddress": "example",
  "chainId": 1,
  "tokenAddress": "example"
}'

twitter-post

1.0.0

Post a tweet using your OAuth access token

$0.015
POST/v1/twitter/post

Parameters

NameTypeDescription
textrequiredstring

Tweet text (max 280 characters)

accessTokenrequiredstring

Your OAuth 2.0 access token for X API (with tweet.write scope)

replyToIdstring

Tweet ID to reply to (optional)

quoteTweetIdstring

Tweet ID to quote (optional)

Example Request

curl -X POST https://api.paytoll.io/v1/twitter/post \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "text": "example",
  "accessToken": "example",
  "replyToId": "example",
  "quoteTweetId": "example"
}'

twitter-tweet-lookup

1.0.0

Look up tweets by ID with metrics and author info (max 10 per call)

$0.02
POST/v1/twitter/tweets

Parameters

NameTypeDescription
idsrequiredarray

Tweet IDs to look up (1-10)

tweetFieldsarray

Tweet fields to return. Defaults to: id, text, author_id, created_at, public_metrics

includeAuthorboolean

Include author user objects in response

Default: true

Example Request

curl -X POST https://api.paytoll.io/v1/twitter/tweets \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "ids": [],
  "tweetFields": [],
  "includeAuthor": true
}'

twitter-user-lookup

1.0.0

Look up X/Twitter user by username or user ID

$0.02
POST/v1/twitter/user

Parameters

NameTypeDescription
usernamestring

Twitter username (without @). Provide username OR userId, not both.

userIdstring

Twitter user ID. Provide username OR userId, not both.

userFieldsarray

User fields to return. Defaults to: id, name, username, description, public_metrics, profile_image_url

Example Request

curl -X POST https://api.paytoll.io/v1/twitter/user \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "username": "example",
  "userId": "example",
  "userFields": []
}'

twitter-user-tweets

1.0.0

Get a user's recent tweets by user ID

$0.08
POST/v1/twitter/user-tweets

Parameters

NameTypeDescription
userIdrequiredstring

Twitter user ID

maxResultsinteger

Number of tweets to return (5-20)

Default: 10

Range: 5 - 20

excludeRepliesboolean

Exclude reply tweets

Default: false

excludeRetweetsboolean

Exclude retweets

Default: false

nextTokenstring

Pagination token from a previous response

tweetFieldsarray

Tweet fields to return. Defaults to: id, text, author_id, created_at, public_metrics

Example Request

curl -X POST https://api.paytoll.io/v1/twitter/user-tweets \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "userId": "example",
  "maxResults": 10,
  "excludeReplies": false,
  "excludeRetweets": false,
  "nextToken": "example",
  "tweetFields": []
}'

wallet-validator

1.0.0

Validate cryptocurrency wallet addresses with checksum verification

$0.0005
POST/v1/crypto/validate

Parameters

NameTypeDescription
addressrequiredstring

Wallet address to validate

networkstringenum: ethereum | bitcoin | solana | auto

Network type (auto-detect if not specified)

Default: "auto"

strictboolean

Enforce checksum validation

Default: true

Example Request

curl -X POST https://api.paytoll.io/v1/crypto/validate \
  -H "Content-Type: application/json" \
  -H "X-Payment: <payment-proof>" \
  -d '{
  "address": "0x...",
  "network": "auto",
  "strict": true
}'