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
- 1Make a request to a free-tier endpoint (for example
/v1/crypto/price). You'll receive a normal response plus free-tier usage headers. - 2Free-tier defaults are 50 calls per IP per UTC day. Some expensive endpoints are paid immediately.
- 3When paid access is required, you'll receive
402 Payment Required. Retry with theX-Paymentheader containing the payment proof signed with your wallet.
aave-best-borrow
1.0.0Find lowest Aave V3 borrow APR across all chains
/v1/aave/best-borrowParameters
| Name | Type | Description |
|---|---|---|
assetrequired | string | Asset symbol (e.g., USDC, ETH, WBTC, DAI) |
chainIds | array | Optional: specific chain IDs to query |
minLiquidity | number | 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.0Find best Aave V3 supply APY across all chains
/v1/aave/best-yieldParameters
| Name | Type | Description |
|---|---|---|
assetrequired | string | Asset symbol (e.g., USDC, ETH, WBTC, DAI) |
chainIds | array | Optional: specific chain IDs to query. Default: all major chains |
minLiquidity | number | 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.0Build an Aave V3 borrow transaction
/v1/aave/borrowParameters
| Name | Type | Description |
|---|---|---|
userAddressrequired | string | Wallet address that will sign the transaction |
tokenAddressrequired | string | ERC20 token contract address to borrow |
amountrequired | string | Amount to borrow (human-readable, e.g. "100.5") |
chainIdrequired | integerenum: 1 | 137 | 42161 | 10 | 8453 | 43114 | Chain ID (1=Ethereum, 137=Polygon, 42161=Arbitrum, 10=Optimism, 8453=Base, 43114=Avalanche) |
marketAddress | string | 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.0Get health factor and liquidation risk for an Aave position
/v1/aave/health-factorParameters
| Name | Type | Description |
|---|---|---|
userAddressrequired | string | Ethereum wallet address |
chainIdrequired | integerenum: 1 | 137 | 42161 | 10 | 8453 | 43114 | Chain ID (1=Ethereum, 137=Polygon, 42161=Arbitrum, 10=Optimism, 8453=Base, 43114=Avalanche) |
marketAddress | string | 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.0Get overview of all Aave V3 markets with TVL and rates
/v1/aave/marketsParameters
| Name | Type | Description |
|---|---|---|
chainIds | array | Optional: specific chain IDs. Default: all major chains. |
topAssetsCount | integer | 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.0Build an Aave V3 repay transaction
/v1/aave/repayParameters
| Name | Type | Description |
|---|---|---|
userAddressrequired | string | Wallet address that will sign the transaction |
tokenAddressrequired | string | ERC20 token contract address to repay |
amount | string | Amount to repay (human-readable). Required unless max is true. |
max | boolean | If true, repay the entire debt position. Overrides amount. |
chainIdrequired | integerenum: 1 | 137 | 42161 | 10 | 8453 | 43114 | Chain ID (1=Ethereum, 137=Polygon, 42161=Arbitrum, 10=Optimism, 8453=Base, 43114=Avalanche) |
marketAddress | string | 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.0Build an Aave V3 supply (deposit) transaction
/v1/aave/supplyParameters
| Name | Type | Description |
|---|---|---|
userAddressrequired | string | Wallet address that will sign the transaction |
tokenAddressrequired | string | ERC20 token contract address to supply |
amountrequired | string | Amount to supply (human-readable, e.g. "100.5") |
chainIdrequired | integerenum: 1 | 137 | 42161 | 10 | 8453 | 43114 | Chain ID (1=Ethereum, 137=Polygon, 42161=Arbitrum, 10=Optimism, 8453=Base, 43114=Avalanche) |
marketAddress | string | 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.0Get all Aave V3 positions for a wallet address
/v1/aave/user-positionsParameters
| Name | Type | Description |
|---|---|---|
userAddressrequired | string | Ethereum wallet address |
chainIds | array | 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.0Build an Aave V3 withdraw transaction
/v1/aave/withdrawParameters
| Name | Type | Description |
|---|---|---|
userAddressrequired | string | Wallet address that will sign the transaction |
tokenAddressrequired | string | ERC20 token contract address to withdraw |
amount | string | Amount to withdraw (human-readable). Required unless max is true. |
max | boolean | If true, withdraw the entire supply position. Overrides amount. |
chainIdrequired | integerenum: 1 | 137 | 42161 | 10 | 8453 | 43114 | Chain ID (1=Ethereum, 137=Polygon, 42161=Arbitrum, 10=Optimism, 8453=Base, 43114=Avalanche) |
marketAddress | string | 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.0Get real-time crypto prices for any coin
/v1/crypto/priceParameters
| Name | Type | Description |
|---|---|---|
symbolrequired | string | Crypto ticker (e.g., BTC, ETH) or CoinGecko ID (e.g., bitcoin, usd-coin). Any CoinGecko-listed coin is supported. |
currency | stringenum: usd | eur | gbp | jpy | Fiat currency for price Default: |
includeMarketData | boolean | Include 24h volume, market cap, etc. Default: |
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.0Check ENS name availability and registration price
/v1/ens/checkParameters
| Name | Type | Description |
|---|---|---|
namerequired | string | 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.0Build a commit transaction for ENS name registration (step 1 of 2)
/v1/ens/commitParameters
| Name | Type | Description |
|---|---|---|
namerequired | string | ENS name to register (without .eth suffix) |
userAddressrequired | string | Ethereum address that will own the name |
duration | integer | Registration duration in seconds (default: 31536000 = 1 year) Range: 2419200 - ∞ |
secret | string | Optional 32-byte hex secret. Auto-generated if not provided. |
reverseRecord | boolean | 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.0Resolve ENS names to Ethereum addresses and perform reverse lookups
/v1/crypto/ensParameters
| Name | Type | Description |
|---|---|---|
name | string | ENS name (e.g., vitalik.eth) |
address | string | Ethereum address for reverse lookup |
resolveAvatar | boolean | Resolve avatar image Default: |
resolveText | array | 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.0Build a register transaction for ENS name registration (step 2 of 2)
/v1/ens/registerParameters
| Name | Type | Description |
|---|---|---|
namerequired | string | ENS name to register (without .eth suffix) |
userAddressrequired | string | Ethereum address that will own the name (must match commit step) |
duration | integer | Registration duration in seconds (must match commit step, default: 31536000 = 1 year) Range: 2419200 - ∞ |
secretrequired | string | The secret from the commit step |
reverseRecord | boolean | 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.0Build a renewal transaction for an existing ENS name
/v1/ens/renewParameters
| Name | Type | Description |
|---|---|---|
namerequired | string | ENS name to renew (without .eth suffix) |
duration | integer | 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.0Anthropic messages proxy — Claude 3/3.5 Haiku family
/v1/ai/anthropic/chatParameters
| Name | Type | Description |
|---|---|---|
messagesrequired | array | Conversation messages |
model | stringenum: claude-3-5-haiku-20241022 | claude-3-haiku-20240307 | Model to use (default: claude-3-haiku-20240307) Default: |
temperature | number | Sampling temperature (0-2) Default: Range: 0 - 2 |
max_tokens | integer | Maximum output tokens (1-4096) Default: 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.0Google Gemini proxy — Gemini 2.0 Flash and Flash Lite
/v1/ai/google/chatParameters
| Name | Type | Description |
|---|---|---|
messagesrequired | array | Conversation messages |
model | stringenum: gemini-2.0-flash | gemini-2.0-flash-lite | Model to use (default: gemini-2.0-flash-lite) Default: |
temperature | number | Sampling temperature (0-2) Default: Range: 0 - 2 |
max_tokens | integer | Maximum output tokens (1-4096) Default: 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.0OpenAI chat completions proxy — GPT-4o mini and GPT-3.5 Turbo
/v1/ai/openai/chatParameters
| Name | Type | Description |
|---|---|---|
messagesrequired | array | Conversation messages |
model | stringenum: gpt-4o-mini | gpt-3.5-turbo | Model to use (default: gpt-4o-mini) Default: |
temperature | number | Sampling temperature (0-2) Default: Range: 0 - 2 |
max_tokens | integer | Maximum output tokens (1-4096) Default: 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.0Get comprehensive on-chain token data (price, supply, FDV, market cap, top pools)
/v1/crypto/onchain/token-dataParameters
| Name | Type | Description |
|---|---|---|
networkrequired | stringenum: eth | base | polygon_pos | arbitrum | optimism | avalanche | bsc | solana | fantom | celo | Network ID (e.g., eth, base, polygon_pos, arbitrum, solana) |
contractAddressrequired | string | 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.0Get on-chain token price by contract address and network (powered by GeckoTerminal)
/v1/crypto/onchain/token-priceParameters
| Name | Type | Description |
|---|---|---|
networkrequired | stringenum: eth | base | polygon_pos | arbitrum | optimism | avalanche | bsc | solana | fantom | celo | Network ID (e.g., eth, base, polygon_pos, arbitrum, solana) |
contractAddressrequired | string | 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.0Search liquidity pools by token name, symbol, or contract address across networks
/v1/crypto/onchain/search-poolsParameters
| Name | Type | Description |
|---|---|---|
queryrequired | string | 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.0Build a DEX swap transaction for signing via Li.Fi
/v1/swap/buildParameters
| Name | Type | Description |
|---|---|---|
userAddressrequired | string | Wallet address that will sign the transaction |
fromChainrequired | integer | Source chain ID (e.g. 1=Ethereum, 8453=Base, 42161=Arbitrum) |
toChain | integer | Destination chain ID (defaults to fromChain for same-chain swap) |
fromTokenrequired | string | Source token address or symbol (e.g. "ETH", "USDC", or contract address) |
toTokenrequired | string | Destination token address or symbol |
amountrequired | string | Amount to swap (human-readable, e.g. "1.5") |
slippage | number | 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.0Get a DEX swap price quote across chains via Li.Fi
/v1/swap/quoteParameters
| Name | Type | Description |
|---|---|---|
fromChainrequired | integer | Source chain ID (e.g. 1=Ethereum, 8453=Base, 42161=Arbitrum) |
toChain | integer | Destination chain ID (defaults to fromChain for same-chain swap) |
fromTokenrequired | string | Source token address or symbol (e.g. "ETH", "USDC", or contract address) |
toTokenrequired | string | Destination token address or symbol |
amountrequired | string | Amount to swap in human-readable form (e.g. "1.5") |
slippage | number | 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.0Check wallet token balance on any supported chain
/v1/crypto/token-balanceParameters
| Name | Type | Description |
|---|---|---|
userAddressrequired | string | Wallet address to check |
chainIdrequired | integerenum: 1 | 10 | 56 | 137 | 8453 | 42161 | 43114 | Chain ID (1=Ethereum, 10=Optimism, 56=BSC, 137=Polygon, 8453=Base, 42161=Arbitrum, 43114=Avalanche) |
tokenAddress | string | 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"
}'trending-pools
1.0.0Get trending liquidity pools on a network sorted by trading activity
/v1/crypto/onchain/trending-poolsParameters
| Name | Type | Description |
|---|---|---|
networkrequired | stringenum: eth | base | polygon_pos | arbitrum | optimism | avalanche | bsc | solana | fantom | celo | Network ID (e.g., eth, base, polygon_pos, solana) |
Example Request
curl -X POST https://api.paytoll.io/v1/crypto/onchain/trending-pools \
-H "Content-Type: application/json" \
-H "X-Payment: <payment-proof>" \
-d '{
"network": "example"
}'twitter-post
1.0.0Post a tweet using your OAuth access token
/v1/twitter/postParameters
| Name | Type | Description |
|---|---|---|
textrequired | string | Tweet text (max 280 characters) |
accessTokenrequired | string | Your OAuth 2.0 access token for X API (with tweet.write scope) |
replyToId | string | Tweet ID to reply to (optional) |
quoteTweetId | string | 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-search
1.0.0Search recent tweets (last 7 days) on X/Twitter
/v1/twitter/searchParameters
| Name | Type | Description |
|---|---|---|
queryrequired | string | Search query (X API query syntax). Example: "bitcoin lang:en -is:retweet" |
maxResults | integer | Number of results (10-20) Default: Range: 10 - 20 |
sortOrder | stringenum: recency | relevancy | Sort order for results Default: |
nextToken | string | Pagination token from a previous response |
tweetFields | array | Tweet fields to return. Defaults to: id, text, author_id, created_at, public_metrics |
includeAuthor | boolean | Include author user objects in response Default: |
Example Request
curl -X POST https://api.paytoll.io/v1/twitter/search \
-H "Content-Type: application/json" \
-H "X-Payment: <payment-proof>" \
-d '{
"query": "example",
"maxResults": 10,
"sortOrder": "recency",
"nextToken": "example",
"tweetFields": [],
"includeAuthor": true
}'twitter-tweet-lookup
1.0.0Look up tweets by ID with metrics and author info (max 10 per call)
/v1/twitter/tweetsParameters
| Name | Type | Description |
|---|---|---|
idsrequired | array | Tweet IDs to look up (1-10) |
tweetFields | array | Tweet fields to return. Defaults to: id, text, author_id, created_at, public_metrics |
includeAuthor | boolean | Include author user objects in response Default: |
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.0Look up X/Twitter user by username or user ID
/v1/twitter/userParameters
| Name | Type | Description |
|---|---|---|
username | string | Twitter username (without @). Provide username OR userId, not both. |
userId | string | Twitter user ID. Provide username OR userId, not both. |
userFields | array | 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.0Get a user's recent tweets by user ID
/v1/twitter/user-tweetsParameters
| Name | Type | Description |
|---|---|---|
userIdrequired | string | Twitter user ID |
maxResults | integer | Number of tweets to return (5-20) Default: Range: 5 - 20 |
excludeReplies | boolean | Exclude reply tweets Default: |
excludeRetweets | boolean | Exclude retweets Default: |
nextToken | string | Pagination token from a previous response |
tweetFields | array | 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.0Validate cryptocurrency wallet addresses with checksum verification
/v1/crypto/validateParameters
| Name | Type | Description |
|---|---|---|
addressrequired | string | Wallet address to validate |
network | stringenum: ethereum | bitcoin | solana | auto | Network type (auto-detect if not specified) Default: |
strict | boolean | Enforce checksum validation Default: |
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
}'