> ## Documentation Index
> Fetch the complete documentation index at: https://docs.messari.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Pay-Per-Request with x402

> Access Messari APIs without an account using USDC micropayments on Base or Solana via x402.

## Overview

x402 is an HTTP-native payment protocol that enables pay-per-request API access using USDC on Base Mainnet or Solana 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:**

<CardGroup cols={3}>
  <Card title="AI Agents" icon="robot">
    Autonomous agents that need to query Messari data without managing API keys or subscriptions
  </Card>

  <Card title="Automated Pipelines" icon="gear">
    Data pipelines that require one-off or sporadic queries billed directly on-chain
  </Card>

  <Card title="One-Off Queries" icon="bolt">
    Quick queries without signing up for an account or committing to a subscription
  </Card>
</CardGroup>

## Supported Endpoints

Endpoint support and pricing can change over time.

<table style={{display:"table", width:"100%", tableLayout:"fixed", wordWrap:"break-word", overflowWrap:"break-word"}}>
  <thead>
    <tr>
      <th style={{width:"25%"}}>Endpoint</th>
      <th style={{width:"35%"}}>Route</th>
      <th style={{width:"10%"}}>Method</th>
      <th style={{width:"30%"}}>Price</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td colSpan="4" style={{background:"rgba(1,115,229,0.1)",padding:"8px 12px",fontSize:"13px",letterSpacing:"0.05em"}}><strong>MessariAI</strong></td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/ai/post-v2-chat-completions">Chat Completion - Messari v2</a></td>
      <td><code>/ai/v2/chat/completions</code></td>
      <td><code>POST</code></td>
      <td><code>\$0.25</code> per request</td>
    </tr>

    <tr>
      <td colSpan="4" style={{background:"rgba(1,115,229,0.1)",padding:"8px 12px",fontSize:"13px",letterSpacing:"0.05em"}}><strong>Assets & Market Data</strong></td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v2/assets/get-v2-assets">List Assets</a></td>
      <td><code>/metrics/v2/assets</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.00</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v2/assets/get-v2-assets-ath">Get All-Time Highs</a></td>
      <td><code>/metrics/v2/assets/ath</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.10</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v2/assets/get-v2-assets-details">Get Asset Details</a></td>
      <td><code>/metrics/v2/assets/details</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.10</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v2/assets/get-v2-assets-metrics">List Metrics</a></td>
      <td><code>/metrics/v2/assets/metrics</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.00</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v2/assets/get-v2-assets-roi">Get ROIs</a></td>
      <td><code>/metrics/v2/assets/roi</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.10</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v2/assets/get-asset-timeseries">Asset Timeseries</a></td>
      <td><code>/metrics/v2/assets/\{assetID}/metrics/\{datasetSlug}/time-series/\{granularity}</code></td>
      <td><code>GET</code></td>
      <td><div><code>1h</code>: <code>\$0.18</code></div><div><code>1d</code>: <code>\$0.15</code></div></td>
    </tr>

    <tr>
      <td colSpan="4" style={{background:"rgba(1,115,229,0.1)",padding:"8px 12px",fontSize:"13px",letterSpacing:"0.05em"}}><strong>Markets</strong></td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v1/get-v1-markets">Get Markets</a></td>
      <td><code>/metrics/v1/markets</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.00</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v1/get-v1-markets-metrics">Get Market Timeseries Metrics</a></td>
      <td><code>/metrics/v1/markets/metrics</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.35</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v1/get-market-timeseries">Get Market Timeseries</a></td>
      <td><code>/metrics/v1/markets/\{entityIdentifier}/metrics/\{datasetSlug}/time-series</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.75</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v1/get-market-timeseries-with-granularity">Get Market Timeseries</a></td>
      <td><code>/metrics/v1/markets/\{entityIdentifier}/metrics/\{datasetSlug}/time-series/\{granularity}</code></td>
      <td><code>GET</code></td>
      <td><div><code>1h</code>: <code>\$1.00</code></div><div><code>1d</code>: <code>\$0.75</code></div></td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v1/get-v1-markets-marketIdentifier">Get Market</a></td>
      <td><code>/metrics/v1/markets/\{marketIdentifier}</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.35</code> per request</td>
    </tr>

    <tr>
      <td colSpan="4" style={{background:"rgba(1,115,229,0.1)",padding:"8px 12px",fontSize:"13px",letterSpacing:"0.05em"}}><strong>Exchanges</strong></td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/exchanges/list-exchanges">List Exchanges</a></td>
      <td><code>/metrics/v1/exchanges</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.00</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/exchanges/list-exchanges-metrics">List Exchanges Metrics</a></td>
      <td><code>/metrics/v1/exchanges/metrics</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.35</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v1/get-exchange-timeseries">Get Exchange Timeseries</a></td>
      <td><code>/metrics/v1/exchanges/\{entityIdentifier}/metrics/\{datasetSlug}/time-series</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.45</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/exchanges/get-exchange-timeseries-metric">Exchange Time Series Metric</a></td>
      <td><code>/metrics/v1/exchanges/\{entityIdentifier}/metrics/\{datasetSlug}/time-series/\{granularity}</code></td>
      <td><code>GET</code></td>
      <td><div><code>1h</code>: <code>\$0.55</code></div><div><code>1d</code>: <code>\$0.45</code></div></td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/exchanges/get-exchange">Get Exchange</a></td>
      <td><code>/metrics/v1/exchanges/\{exchangeIdentifier}</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.35</code> per request</td>
    </tr>

    <tr>
      <td colSpan="4" style={{background:"rgba(1,115,229,0.1)",padding:"8px 12px",fontSize:"13px",letterSpacing:"0.05em"}}><strong>Networks</strong></td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v2/networks/get-v2-networks">Networks</a></td>
      <td><code>/metrics/v2/networks</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.00</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v2/networks/get-v2-networks-metrics">Network Metrics</a></td>
      <td><code>/metrics/v2/networks/metrics</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.00</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v2/networks/get-network-timeseries">Network Time Series</a></td>
      <td><code>/metrics/v2/networks/\{entityIdentifier}/metrics/\{datasetSlug}/time-series</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.15</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/metrics/v2/networks/get-time-series-timeseries-with-granularity">Network Time Series with Granularity</a></td>
      <td><code>/metrics/v2/networks/\{entityIdentifier}/metrics/\{datasetSlug}/time-series/\{granularity}</code></td>
      <td><code>GET</code></td>
      <td><div><code>5m</code>: <code>\$0.25</code></div><div><code>15m</code>: <code>\$0.23</code></div><div><code>1h</code>: <code>\$0.18</code></div><div><code>1d</code>: <code>\$0.15</code></div></td>
    </tr>

    <tr>
      <td colSpan="4" style={{background:"rgba(1,115,229,0.1)",padding:"8px 12px",fontSize:"13px",letterSpacing:"0.05em"}}><strong>Stablecoins</strong></td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/stablecoins/list-stablecoins">List Stablecoins</a></td>
      <td><code>/metrics/v2/stablecoins</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.00</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/stablecoins/list-stablecoin-metrics">List Stablecoin Metrics</a></td>
      <td><code>/metrics/v2/stablecoins/metrics</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.00</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/stablecoins/stablecoin-timeseries-metric">Stablecoin Timeseries Metric</a></td>
      <td><code>/metrics/v2/stablecoins/\{entityIdentifier}/metrics/\{datasetSlug}/time-series</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.25</code> per request</td>
    </tr>

    <tr>
      <td colSpan="4" style={{background:"rgba(1,115,229,0.1)",padding:"8px 12px",fontSize:"13px",letterSpacing:"0.05em"}}><strong>Fundraising</strong></td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/funding/funds/get-v1-funds">Funds</a></td>
      <td><code>/funding/v1/funds</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.35</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/funding/funds/get-v1-funds-managers">Funds Managers</a></td>
      <td><code>/funding/v1/funds/managers</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.25</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/funding/mergers-acquisitions/get-v1-mergers-and-acquisitions">Mergers and Acquisitions</a></td>
      <td><code>/funding/v1/mergers-and-acquisitions</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.25</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/funding/entities/get-v1-organizations">Organizations</a></td>
      <td><code>/funding/v1/organizations</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.25</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/funding/entities/get-v1-projects">Projects</a></td>
      <td><code>/funding/v1/projects</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.15</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/funding/fundraising-rounds/get-v1-rounds">Rounds</a></td>
      <td><code>/funding/v1/rounds</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.15</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/funding/fundraising-rounds/get-v1-rounds-investors">Rounds Investors</a></td>
      <td><code>/funding/v1/rounds/investors</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.25</code> per request</td>
    </tr>

    <tr>
      <td colSpan="4" style={{background:"rgba(1,115,229,0.1)",padding:"8px 12px",fontSize:"13px",letterSpacing:"0.05em"}}><strong>News</strong></td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/news/get-v1-news-feed">News Feed</a></td>
      <td><code>/news/v1/news/feed</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.55</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/news/get-v1-news-sources">Get News Sources</a></td>
      <td><code>/news/v1/news/sources</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.00</code> per request</td>
    </tr>

    <tr>
      <td colSpan="4" style={{background:"rgba(1,115,229,0.1)",padding:"8px 12px",fontSize:"13px",letterSpacing:"0.05em"}}><strong>Signals</strong></td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/signal/assets/get-v1-assets">Assets</a></td>
      <td><code>/signal/v1/assets</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.55</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/signal/assets/get-v1-assets-mindshare-gainers-24h">Mindshare Gainers 24H</a></td>
      <td><code>/signal/v1/assets/mindshare-gainers-24h</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.35</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/signal/assets/get-v1-assets-mindshare-gainers-7d">Mindshare Gainers 7D</a></td>
      <td><code>/signal/v1/assets/mindshare-gainers-7d</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.35</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/signal/assets/get-v1-assets-mindshare-losers-24h">Mindshare Losers 24H</a></td>
      <td><code>/signal/v1/assets/mindshare-losers-24h</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.35</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/signal/assets/get-v1-assets-mindshare-losers-7d">Mindshare Losers 7D</a></td>
      <td><code>/signal/v1/assets/mindshare-losers-7d</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.35</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/signal/assets/get-v1-assets-time-series-granularity">Assets Time Series with Granularity</a></td>
      <td><code>/signal/v1/assets/time-series/\{granularity}</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.75</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/signal/assets/get-v1-assets-assetID">Asset by ID</a></td>
      <td><code>/signal/v1/assets/\{assetID}</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.35</code> per request</td>
    </tr>

    <tr>
      <td colSpan="4" style={{background:"rgba(1,115,229,0.1)",padding:"8px 12px",fontSize:"13px",letterSpacing:"0.05em"}}><strong>Token Unlocks</strong></td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/token-unlocks/get-v1-allocations">Get Allocations</a></td>
      <td><code>/token-unlocks/v1/allocations</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.25</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/token-unlocks/get-v1-assets">Get Assets</a></td>
      <td><code>/token-unlocks/v1/assets</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.00</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/token-unlocks/get-v1-assets-assetId-events">Get Asset Events</a></td>
      <td><code>/token-unlocks/v1/assets/\{assetId}/events</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.15</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/token-unlocks/get-v1-assets-assetId-unlocks">Get Asset Unlocks</a></td>
      <td><code>/token-unlocks/v1/assets/\{assetId}/unlocks</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.75</code> per request</td>
    </tr>

    <tr>
      <td><a href="/api-reference/endpoints/token-unlocks/get-v1-assets-assetId-vesting-schedule">Get Asset Vesting Schedule</a></td>
      <td><code>/token-unlocks/v1/assets/\{assetId}/vesting-schedule</code></td>
      <td><code>GET</code></td>
      <td><code>\$0.75</code> per request</td>
    </tr>
  </tbody>
</table>

For machine-readable discovery, call `GET https://api.messari.io/.well-known/x402`.

## Prerequisites

Before making a payment, ensure you have:

<Tabs>
  <Tab title="Base (EVM)">
    * 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

    <Card title="Bridge to Base" icon="bridge" href="https://bridge.base.org">
      Use bridge.base.org to move USDC from Ethereum or another chain onto Base Mainnet.
    </Card>
  </Tab>

  <Tab title="Solana">
    * A Solana wallet (e.g. Phantom, Solflare)
    * **USDC on Solana Mainnet** — a minimum of \~\$1 is recommended to start
    * A small amount of **SOL** for transaction fees (typically under \$0.001 per transaction)
  </Tab>
</Tabs>

## 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 options for each supported chain (Base and Solana), including amount, currency, recipient address, and network.

**Step 2: Sign & pay**

Your x402-enabled client selects the chain it's configured for and creates a payment:

* **Base:** Signs a USDC `TransferWithAuthorization` (EIP-3009) message — no gas required for the authorization itself.
* **Solana:** Builds and partially signs a USDC transfer transaction — gas fees are near-zero (\~\$0.001).

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)

<Tabs>
  <Tab title="Base (EVM)">
    ```bash theme={null}
    npm install @x402/fetch @x402/evm viem
    ```

    ```typescript theme={null}
    import { wrapFetchWithPaymentFromConfig } from '@x402/fetch';
    import { ExactEvmScheme } from '@x402/evm';
    import { privateKeyToAccount } from 'viem/accounts';

    const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);

    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);
    ```
  </Tab>

  <Tab title="Solana">
    ```bash theme={null}
    npm install @x402/fetch @x402/svm @solana/kit
    ```

    ```typescript theme={null}
    import { wrapFetchWithPaymentFromConfig } from '@x402/fetch';
    import { ExactSvmScheme } from '@x402/svm';
    import { createKeyPairSignerFromBytes, getBase58Codec } from '@solana/kit';

    const codec = getBase58Codec();
    const keyBytes = codec.encode(process.env.SOLANA_PRIVATE_KEY!);
    const signer = await createKeyPairSignerFromBytes(keyBytes);

    const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
      schemes: [{ network: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp', client: new ExactSvmScheme(signer) }],
    });

    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);
    ```
  </Tab>
</Tabs>

<Warning>
  Never hardcode your private key in source code. Use environment variables for both EVM (`process.env.PRIVATE_KEY`) and Solana (`process.env.SOLANA_PRIVATE_KEY`) keys.
</Warning>

## 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"**

Supported networks are `eip155:8453` (Base Mainnet) and `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` (Solana 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](https://basescan.org). If the transaction is confirmed but you still received no response, contact [api@messari.io](mailto:api@messari.io).

**"Transaction simulation failed" (Solana)**

The recipient wallet may not have a USDC token account on Solana. Ensure the payTo address has an Associated Token Account for USDC. You can create one by sending a small amount of USDC to that address.

**Payment sent but no response received (Solana)**

Solana transactions typically confirm in under a second. If you do not receive a response after 60 seconds, check the transaction on [Solana Explorer](https://explorer.solana.com). If the transaction is confirmed but you still received no response, contact [api@messari.io](mailto:api@messari.io).
