Skip to main content

Overview

x402 is an HTTP-native payment protocol that enables pay-per-request API access using USDC on Base Mainnet. With x402, you can access Messari endpoints without a Messari account or API key — simply pay per request with crypto. When to use x402:

AI Agents

Autonomous agents that need to query Messari data without managing API keys or subscriptions

Automated Pipelines

Data pipelines that require one-off or sporadic queries billed directly on-chain

One-Off Queries

Quick queries without signing up for an account or committing to a subscription

Supported Endpoints

Endpoint support and pricing can change over time.
EndpointRouteMethodPrice
MessariAI
Chat Completion - Messari v2/ai/v2/chat/completionsPOST$0.25 per request
Assets & Market Data
List Assets/metrics/v2/assetsGET$0.00 per request
Get All-Time Highs/metrics/v2/assets/athGET$0.10 per request
Get Asset Details/metrics/v2/assets/detailsGET$0.10 per request
List Metrics/metrics/v2/assets/metricsGET$0.00 per request
Get ROIs/metrics/v2/assets/roiGET$0.10 per request
Asset Timeseries/metrics/v2/assets/{assetID}/metrics/{datasetSlug}/time-series/{granularity}GET
1h: $0.18
1d: $0.15
Markets
Get Markets/metrics/v1/marketsGET$0.00 per request
Get Market Timeseries Metrics/metrics/v1/markets/metricsGET$0.35 per request
Get Market Timeseries/metrics/v1/markets/{entityIdentifier}/metrics/{datasetSlug}/time-seriesGET$0.75 per request
Get Market Timeseries/metrics/v1/markets/{entityIdentifier}/metrics/{datasetSlug}/time-series/{granularity}GET
1h: $1.00
1d: $0.75
Get Market/metrics/v1/markets/{marketIdentifier}GET$0.35 per request
Exchanges
List Exchanges/metrics/v1/exchangesGET$0.00 per request
List Exchanges Metrics/metrics/v1/exchanges/metricsGET$0.35 per request
Get Exchange Timeseries/metrics/v1/exchanges/{entityIdentifier}/metrics/{datasetSlug}/time-seriesGET$0.45 per request
Exchange Time Series Metric/metrics/v1/exchanges/{entityIdentifier}/metrics/{datasetSlug}/time-series/{granularity}GET
1h: $0.55
1d: $0.45
Get Exchange/metrics/v1/exchanges/{exchangeIdentifier}GET$0.35 per request
Networks
Networks/metrics/v2/networksGET$0.00 per request
Network Metrics/metrics/v2/networks/metricsGET$0.00 per request
Network Time Series/metrics/v2/networks/{entityIdentifier}/metrics/{datasetSlug}/time-seriesGET$0.15 per request
Network Time Series with Granularity/metrics/v2/networks/{entityIdentifier}/metrics/{datasetSlug}/time-series/{granularity}GET
5m: $0.25
15m: $0.23
1h: $0.18
1d: $0.15
Stablecoins
List Stablecoins/metrics/v2/stablecoinsGET$0.00 per request
List Stablecoin Metrics/metrics/v2/stablecoins/metricsGET$0.00 per request
Stablecoin Timeseries Metric/metrics/v2/stablecoins/{entityIdentifier}/metrics/{datasetSlug}/time-seriesGET$0.25 per request
Fundraising
Funds/funding/v1/fundsGET$0.35 per request
Funds Managers/funding/v1/funds/managersGET$0.25 per request
Mergers and Acquisitions/funding/v1/mergers-and-acquisitionsGET$0.25 per request
Organizations/funding/v1/organizationsGET$0.25 per request
Projects/funding/v1/projectsGET$0.15 per request
Rounds/funding/v1/roundsGET$0.15 per request
Rounds Investors/funding/v1/rounds/investorsGET$0.25 per request
News
News Feed/news/v1/news/feedGET$0.55 per request
Get News Sources/news/v1/news/sourcesGET$0.00 per request
Signals
Assets/signal/v1/assetsGET$0.55 per request
Mindshare Gainers 24H/signal/v1/assets/mindshare-gainers-24hGET$0.35 per request
Mindshare Gainers 7D/signal/v1/assets/mindshare-gainers-7dGET$0.35 per request
Mindshare Losers 24H/signal/v1/assets/mindshare-losers-24hGET$0.35 per request
Mindshare Losers 7D/signal/v1/assets/mindshare-losers-7dGET$0.35 per request
Assets Time Series with Granularity/signal/v1/assets/time-series/{granularity}GET$0.75 per request
Asset by ID/signal/v1/assets/{assetID}GET$0.35 per request
X Users Listing/signal/v1/x-usersGET$0.55 per request
X Users Time Series/signal/v1/x-users/time-series/{granularity}GET$0.75 per request
X User by Identifier/signal/v1/x-users/{xUserID}GET$0.35 per request
Token Unlocks
Get Allocations/token-unlocks/v1/allocationsGET$0.25 per request
Get Assets/token-unlocks/v1/assetsGET$0.00 per request
Get Asset Events/token-unlocks/v1/assets/{assetId}/eventsGET$0.15 per request
Get Asset Unlocks/token-unlocks/v1/assets/{assetId}/unlocksGET$0.75 per request
Get Asset Vesting Schedule/token-unlocks/v1/assets/{assetId}/vesting-scheduleGET$0.75 per request
For machine-readable discovery, call GET https://api.messari.io/.well-known/x402.

Prerequisites

Before making a payment, ensure you have:
  • An EVM-compatible wallet (e.g. MetaMask, Coinbase Wallet)
  • USDC on Base Mainnet — a minimum of ~$1 is recommended to start
  • A small amount of ETH on Base Mainnet for gas fees

Bridge to Base

Use bridge.base.org to move USDC from Ethereum or another chain onto Base Mainnet.

How It Works

x402 follows a simple 3-step flow: Step 1: Make a request Send your request to the Messari API without an API key. The gateway responds with HTTP 402 Payment Required along with payment requirements (amount, currency, recipient address, network). Step 2: Sign & pay Your x402-enabled client signs a USDC TransferWithAuthorization EIP-3009 message using your wallet’s private key. No gas is required for the authorization itself — the gateway submits the on-chain transaction on your behalf. Step 3: Request fulfilled The gateway verifies the signed authorization, collects the USDC payment, and proxies your original request. The API response is returned as normal.

Quick Start (TypeScript)

Install the x402 fetch wrapper:
npm install @x402/fetch @x402/evm viem
Make your first pay-per-request call:
import { wrapFetchWithPaymentFromConfig } from '@x402/fetch';
import { ExactEvmScheme } from '@x402/evm';
import { privateKeyToAccount } from 'viem/accounts';

const account = privateKeyToAccount('0xYOUR_PRIVATE_KEY');

const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: 'eip155:8453', client: new ExactEvmScheme(account) }],
});

const response = await fetchWithPayment('https://api.messari.io/ai/v2/chat/completions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    messages: [{ role: 'user', content: 'What is the latest on Bitcoin?' }],
    verbosity: 'succinct',
    response_format: 'markdown',
    stream: false,
  }),
});

const data = await response.json();
console.log(data);
Never hardcode your private key in source code. Use environment variables: privateKeyToAccount(process.env.PRIVATE_KEY as \0x$`)`.

Troubleshooting

“Payment verification failed” Your wallet does not have sufficient USDC on Base Mainnet. Check your balance and ensure you have enough USDC plus a small amount of ETH for gas. “Unsupported network” You must use eip155:8453 (Base Mainnet). Payment sent but no response received On-chain confirmation can take ~30 seconds. If you do not receive a response after 60 seconds, check the transaction status on Basescan. If the transaction is confirmed but you still received no response, contact api@messari.io.