AIInfrastructure

x402: How Messari Is Opening Its Data Layer to Autonomous Agents

BLUF: x402 is a ridiculously simple way to pay for an API by just making an HTTP request. No credit card, no Stripe setup, no logins — a wallet with USDC is all that’s needed. That simplicity makes it perfect for agent-to-agent payments. At Messari, we've adopted x402 to bring our institutional-grade crypto intelligence to every builder and agent on the internet.

Messari + x402: Institutional Data for Every Builder

At Messari, our APIs have long served institutions and enterprises in crypto — hedge funds, VCs, research desks, and protocol teams who need comprehensive market intelligence to make decisions. We cover 40,000+ assets and provide deep analytics on market data, on-chain data, token unlocks, fundraising, X mindshare, trending topics, and more.

But historically, accessing this data meant signing up for an account, talking to sales, signing a contract, and setting up billing. That's a reasonable process for an enterprise customer. It's a massive hurdle for a weekend builder, a student experimenting with crypto data, or — critically — an AI agent that needs market intelligence to complete a task.

We see x402 as the bridge. It brings Messari's institutional-grade data onto a wider set of builders without compromising the depth or quality that our enterprise customers rely on. A developer in Lagos can query Messari's AI chat endpoint for a crypto market summary and pay $0.10 in USDC. An autonomous agent managing a DeFi portfolio can pull real-time asset data, token unlock schedules, and market signals — paying per request, no contract needed.

Here's the pricing breakdown for Messari's x402 endpoints.

The philosophy is simple: access to Messari’s enterprise-grade data, paid in a way that agents and builders can use natively, dynamically with low-friction.

What is x402?

x402 Payment Protocol Flow

Every developer knows HTTP status codes. 200 means success. 404 means not found. But there's one code that's been sitting dormant in the HTTP spec since 1997: 402 Payment Required. For nearly three decades, the spec simply said "reserved for future use."

The future arrived in 2025.

x402 is an open, internet-native payment protocol developed by Coinbase that revives that long-dormant status code and turns it into something real: a standardized way for applications, APIs, and AI agents to send and receive instant stablecoin payments directly over HTTP. No accounts, no sessions, no legacy billing rails required.

The protocol was co-founded by Coinbase and Cloudflare, and has since been adopted by Google, Vercel, Stripe, and Solana as part of the emerging agentic payments stack. It works on Base, Solana, and an expanding set of EVM chains.

Here's the beauty of it: x402 is just HTTP with a payment header. When you hit an x402-enabled endpoint, the server responds with a 402 Payment Required status code along with the price, wallet address, and chain. Your client signs a USDC payment authorization, attaches it to the request header, and re-sends. The server verifies the payment through a facilitator (Coinbase being the most common), collects the USDC, and returns your data. Done.


That's it. If you can make an HTTP request, you can make an x402 payment. Most users don't need to think about the payment flow at all — the libraries handle it. But it's worth appreciating how seamlessly x402 interfaces with the existing request/response pattern that powers the entire internet.

What Problem Does x402 Solve?

The internet was built on a simple model: request, response. A client asks for something, a server sends it back. HTTP made this so reliable that it became the backbone of every digital interaction — web pages, APIs, streaming, and now agents.

Agents are hungry to interface with the world, but without the ability to make payments, an agent is limited in the actions it can take. Here’s the current paradigm for payments on the web: when you and I (humans) wants to buy something online, we get redirected to a checkout page, enter a credit card number, authenticate through a bank, wait for a merchant processor to approve the transaction, and then finally get routed back to the item we purchased. Additionally, traditional payment rails weren't built for micropayments. Stripe has a minimum threshold of $0.50+ per transaction and charges $0.30 + 2.9% in fee, making small payments impractical. That's fine for humans doing e-commerce. It's impractical for agents.

Stablecoin payments on blockchain don't have these constraints. They aren't beholden to fixed fee structures — the only cost is gas, which on Base averages around $0.015 and on Solana is closer to $0.003. They settle near-instantly with finality. And native programmability enables conditional payments: payment is made only if a specific condition, like a valid API response, is met.

But cheap settlement alone isn't enough. You also need a protocol — a standardized way for any client to discover that a service costs money, learn the price, pay, and receive the goods.

Back to the ubiquity of HTTP. x402 is an HTTP protocol with HTTP code 402. It augments the capability of HTTP and makes payment native to the way software already communicates. No OAuth flows, no billing dashboards. Just an HTTP header.

The result is that the "pay" action becomes as simple as the "HTTP GET" action. And when paying is as frictionless as fetching, agents can operate through of micro-decisions and micro-transactions.

agents, take my money

Now that is not to say that an agent can just go rogue and spend all the fund it has. This is where guardrails at the agent level and the wallet level are important. [more on this later]

Getting Started with Messari x402

Okay, that’s enough background information. Let’s walk through using x402 in practice.

Custodial vs Non-custodial Wallets

There are several ways to connect to Messari's x402-enabled APIs depending on your setup and preferences. I'll walk through each one. The main factor in your choice of integration is whether you prefer a custodial or non-custodial wallet. For a custodial wallet, a third party like Coinbase or AgentCash manages your private keys. While for non-custodial wallets, you have full responsibility for manage and securing your private keys.

Coinbase Payments MCP

The quickest way to get started without managing private keys is by leveraging Coinbase's Payments MCP. This gives you easy hosted wallet authenticated with your Coinbase account. Payments MCP gives Claude (and other MCP-compatible agents) a wallet and the ability to discover and pay for x402 services autonomously. Authenticate with your email, fund the embedded wallet with USDC on Base through Coinbase Onramp, and you're live. Your agent can now discover x402 endpoints, evaluate pricing, make payments, and retrieve data — all without you lifting a finger after the initial setup.

1. Coinbase Payments MCP + Claude Desktop

1.1 Install the Coinbase Payment MCP

Close Claude Desktop if it is open and run the following command in your terminal

npx @coinbase/payments-mcp@latest --client claude --auto-config

claude install

Now if you launch Claude Desktop you should see the payment-mcp listed under “Local MCP Servers”

local mcp in claude

1.2 Authenticate with your x402 wallet

Now you can ask Claude to Open the payments-mcp wallet

authenticate payments mcp

Sign with your coinbase email and your wallet is ready to use. Add USDC to the wallet with the “Fund” or “Receive” buttons

sign-in coinbase

1.3 Get the Messari Skill

Now you’re all set wallet wise, we need to install the Messari Skill (a markdown document to let Claude know how to interact with our APIs)

  • Download this messari.skill file
  • Click the file to open it with Claude Desktop
  • Click “Add to Library”

1.4 Usage

And you’re done! You can now ask Messari anything about crypto directly from Claude

2. Coinbase Payments MCP + Claude Code (Command-line)

For Claude Code users instead of Claude Desktop, the setup process is very similar but there are some small differences.

2.1 Install the Coinbase Payment MCP

Close any open Claude Code sessions and run the following command in your terminal:

npx @coinbase/payments-mcp@latest --client claude-code --auto-config

Run the command shown to you.

IMPORTANT: Double check the quotes when copying the command, it should be claude mcp add --transport stdio payments-mcp --scope user "COMMAND" "ARGS"

not

claude mcp add --transport stdio payments-mcp --scope user "COMMAND ARGS"

Once done, start a Claude Code session and check the status of the MCP server with /mcp command, you should see the payments-mcp server connected

2.2 Authenticate with your x402 wallet

Now you can ask Claude to Open the payments-mcp wallet

You can then sign into your coinbase account and add USDC to the wallet with the “Fund” or “Receive” buttons.

2.3 Get the Messari Skill

Now that your wallet is ready, you can add the Messari Skill

npx skills add messari/skills -a claude-code

Claude Code should now have the Messari Skill available

2.4 Usage

And now you’re ready to ask Messari anything about crypto

3. With OpenClaw

OpenClaw (the open-source autonomous agent formerly known as Moltbot) is an very popular AI Agent framework.

3.1 Install the Messari Skill

It’s very easy to add the Messari skill to your OpenClaw. In the project directory, run the following command:

mkdir -p skills/messari && curl -o skills/messari/SKILL.md https://raw.githubusercontent.com/messari/skills/refs/heads/master/openclaw-skill/SKILL.md

3.2 Add the Environment Variables

Instead of using a custodial wallet like Coinbase, we’ll be using a self-hosted wallet with a private key. Add the key to your ~/.openclaw/openclaw.json file.

🚨 IMPORTANT SECURITY NOTICE 🚨: The OpenClaw agent framework is not considered a secure system. Secrets and private keys are potentially at risk of leaking due to prompt injection, malicious third party authored skills and other security vulnerabilities. Before saving a wallet private key, you should create a new wallet and consider it insecure. Keep only the minimum amount of USDC required in it. Read more about OpenClaw security here


{
"skills": {
"install": {
"nodeManager": "npm"
},
"entries": {
"messari": {
"enabled": true,
"env": {
"X402_PRIVATE_KEY": ""
}
}
}
}
}


Restart OpenClaw to apply the changes. And check that the skill is installed.



3.3 Usage

And now you're ready to ask Messari anything about crypto through your OpenClaw.


4. With TypeScript / Python + Wallet



For developers looking to call the our APIs directly. x402 has convenient packages that handle the signing in Typescript, Python and Golang, some examples below. See [docs.messari.io/api-reference/x402-payments](<http://docs.messari.io/api-reference/x402-payments>) for the full catalog of available endpoints.

TypeScript:

npm install @x402/fetch @x402/evm viem

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 happening in crypto today?' }],
verbosity: 'succinct',
response_format: 'markdown',
stream: false,
}),
}
);

const data = await response.json();
console.log(data);

Python:

pip install x402-python

import os
from x402 import PaymentClient

client = PaymentClient(
private_key=os.environ["PRIVATE_KEY"],
network="base"
)

response = client.fetch(
"<https://api.messari.io/ai/v2/chat/completions>",
method="POST",
json={
"messages": [{"role": "user", "content": "Top crypto news today?"}],
"verbosity": "succinct",
"response_format": "markdown",
"stream": False,
}
)

print(response.json())

The steps to get going are simple:

  1. Send a small amount of USDC to a wallet on Base ($1 is more than sufficient)
  2. Export your private key as an environment variable (never hardcode it)
  3. Run the script above

The payment transaction gets logged onchain on Base. You can verify it on Basescan.

5. Video Demos

We're building out video walkthroughs for each integration path. Check the Messari docs for the latest demos and tutorials — we update these frequently as the ecosystem evolves.

The x402 Ecosystem

x402 isn't just Messari. The ecosystem is expanding rapidly, and it's worth understanding the landscape.

x402scan

x402scan is the ecosystem explorer for x402 — think Etherscan but for x402 payments. It tracks live transaction volume, active facilitators, top resources, and network breakdowns across the protocol.

The numbers are still early days. But the trajectory is what matters. Transaction volumes have surged 700%+ in recent months, and the average transaction size has declined from $2.50 at launch to around $0.06 — a clear signal that the protocol is finding its footing in true micropayment territory rather than one-off experiments.

The x402 Foundation (established by Coinbase and Cloudflare) maintains an ecosystem directory that continues to grow. Current participants include facilitators like Dexter, PayAI, and Heurist; chains like Base, Solana, and Polygon PoS; and a growing roster of API providers, agent frameworks, and tooling.

Discoverability by Agents: Untapped Potential

Here's the thing that excites me most about x402: discoverability.

Right now, most APIs require a developer to know they exist, read the docs, sign up, get an API key, and integrate. That's a human-driven discovery process. With x402, an agent can discover a paid service at the protocol level. It hits an endpoint, gets a 402 response with pricing, and decides in real time whether the data is worth paying for.

This inverts the API discovery model. Instead of developers finding APIs and wiring them into agents, agents can find APIs themselves and pay on the spot. Google's integration of x402 into its Agentic Payments Protocol (AP2) is an early signal of this direction — agents that can autonomously discover, evaluate, and pay for services.

We're still early on the discoverability front. The tooling for agents to browse, compare, and select x402 services is nascent. But the foundation is laid: a standardized payment interface means that building agent-native service marketplaces becomes much simpler. This is an area Messari is watching closely and actively building toward.

The Future: What can this become?

Three foundational protocol layers are converging: x402 for payments, ERC‑8004 for identity and reputation, and autonomous agent frameworks such as OpenClaw. Together, these protocol layers define the infrastructure for an economy in which autonomous agents and humans transact side by side.

This vision is beginning to materialize through our x402 launch, which allows agents to query Messari for market intelligence and generate an institutional‑quality crypto briefing.

Powered by x402’s integration of payments and data exchange, autonomous agents can now operate as active participants in financial markets. Imagine, for instance, a portfolio manager who wakes up each morning, pulls Messari for a market briefing, runs a sentiment analysis API for social signals, references an onchain analytics service for whale activity, then synthesizes these inputs to rebalance a portfolio. Each interaction is an agent‑to‑agent payment, and each service is discovered and evaluated without human involvement.

Or consider an agent that manages a treasury for a DAO. It monitors governance proposals across protocols, pays for legal analysis on regulatory implications, pays for financial modeling on treasury allocation scenarios, and presents recommendations to token holders, all autonomously.

We are at the early days and are seeing an inkling of whats possible for an autonomous economic actor on x402 and Base. Agents deploying smart contracts, publishing code, managing capital, and delivering services to other agents. While experimental, it is illustrating a broader pattern in which agents earn, spend, and compound reputation through real economic activity.

The infrastructure required to unlock this model is taking shape. x402 gives agents the ability to pay for digital resources. ERC-8004 gives them persistent identity and verifiable reputation. Products like Payments MCP, AgentCash, Bankrbot, and Clanker give them access to wallets and capital. MCP and Agent2Agent (A2A) give them communication standards.

At Messari, our research and data have always been built for decision-makers, and increasingly those decision-makers will include machines. x402 is how we meet agents at the API layer: paying per request via frictionless protocol.

For deeper analysis, our research team has published several pieces that map out the agent economy:

If you are building with agents and want to integrate Messari's data, start here: docs.messari.io/api-reference/x402-payments. Let us know what you would like to see from us next! Reach out to us at api@messari.io or https://messari.io/contact!

Let us know what you loved about the report, what may be missing, or share any other feedback by filling out this short form. All responses are subject to our Privacy Policy and Terms of Service.

Diran is the CTO at Messari. His domain of expertise ranges between AI, crypto, and enterprise software.

Daniel Khoo

Daniel Khoo is a software engineer at Messari. His domain of expertise ranges from AI, to frontend, to backend services.

Suggested Research Based on your Watchlists

Create a new watchlist
Outline
  • Messari + x402: Institutional Data for Every Builder
  • What is x402?
  • What Problem Does x402 Solve?
  • Getting Started with Messari x402
  • The x402 Ecosystem
  • The Future: What can this become?
Authors
Diran is the CTO at Messari. His domain of expertise ranges between AI, crypto, and enterprise software.
Daniel Khoo is a software engineer at Messari. His domain of expertise ranges from AI, to frontend, to backend services.