Crypto market data for AI agents: llms.txt, OpenAPI and MCP

How to give an AI agent live crypto derivatives data: llms.txt, OpenAPI for tool calling, MCP servers, keyless access, freshness and safe key handling.

In short

An AI agent can only report what it can read. A language model knows nothing about today's funding rates or last hour's liquidations; to answer such questions it needs a tool that fetches live data and returns it in a shape the model can use correctly. Three formats make that work: an llms.txt file that tells the model where things are, an OpenAPI document that describes every call precisely, and an MCP server that exposes the calls as ready-made tools.

This guide explains what each format does, what an agent needs beyond them (freshness, units, errors, limits) and how to keep keys and outputs safe. The examples use our own API, which offers all three.

What an agent needs from a data source

A human developer reads the docs once and writes code. An agent reads them every time, inside a limited context window, and acts on what it understood. That changes what good documentation looks like:

  • A short map of what exists, so the model does not have to crawl a website.
  • Exact parameters and types, so calls are valid on the first try.
  • Errors the model can act on, saying what was wrong and whether a retry helps.
  • Timestamps and sources in every answer, so the agent can say how fresh the data is and where it came from.
  • Access that does not depend on a secret in the prompt.

llms.txt: the map

llms.txt is a proposed convention: a Markdown file at the root of a website with a title, a short summary and sections of links to detailed Markdown pages. The proposal describes it as a file that offers brief background information, guidance and links to detailed Markdown files.1 A model that is pointed at a site can read this one file and know where the reference, the guides and the examples are.

Our llms.txt lists what the API does, the documentation pages and every endpoint in one line each. Next to it, the full API reference is available as a single Markdown file (/docs/api.md), and /llms-skill.md is an agent skill that explains how to fetch the data and how to present it.2

OpenAPI: exact calls for tool calling

The OpenAPI Specification defines a standard, language-agnostic description of HTTP APIs: every path, parameter, type and response.3 Many agent frameworks can turn an OpenAPI document into callable functions directly, so the model sees typed tools instead of prose.

Our OpenAPI 3.1 document is served at /api/v1/openapi.json, and every operation has an id and typed parameters.2 The API explorer runs each operation in the browser and shows the same request in curl, TypeScript, Python and Go. Because the docs, the Markdown reference and the OpenAPI document are generated from the same source, an agent does not read parameters that no longer exist.

MCP: tools without glue code

The Model Context Protocol is an open protocol for connecting language model applications to external data and tools. A host application connects to MCP servers, and each server can offer resources, prompts and tools; the messages use JSON-RPC 2.0.4 For a data source, an MCP server means the model gets named tools such as "get the liquidation heatmap of a coin" with their arguments, without anyone writing code for each call.

Our MCP server offers read-only tools for the liquidation heatmap, liquidations, whales, funding, order flow, radar events and more. It is live in two forms. The remote server at https://api.blockmetric.io/mcp (Streamable HTTP) is added as a remote MCP server in ChatGPT, Claude.ai or any MCP client, with nothing to install. The local server is the npm package blockmetric-mcp for Claude Desktop, Claude Code and Cursor. Without a key the remote server uses public access; with a key, the key's plan, history and limits apply.2

Starting without a key

An agent can try the API before anyone signs up. Requests that send the header X-Blockmetric-Access: public and no key get the free public tier, with a short history window and small limits per IP address.2 A key gives the agent more history and its own limits, as listed on API pricing.

Freshness, units and sources

Market data is only meaningful with its time. Every answer of our API carries a meta object with the data time in UTC and the finished credit line to show next to the data.5 An agent that repeats a number should repeat its time as well: "funding was X at 14:05 UTC" is a fact; "funding is X" may already be wrong.

Units need the same care. Funding is returned as a fraction per period, distances and shares as fractions, money in USD, sizes in coins unless the field name says USD.5 A model that reads a fraction as a percentage is off by a factor of a hundred, so a short note in the agent's instructions pays off.

Errors an agent can fix

Errors come back as a JSON object with a code, a message, a link to the matching documentation, a request id and a retryable flag.5 That gives an agent a clear decision: if retryable is true, wait and try again; if not, the request itself has to change, and the message and the doc link say how. Rate limits answer 429 with headers that say when to try again, explained in API rate limits and API keys.

Keeping keys and outputs safe

  • Keys stay out of prompts. Never paste a key into a prompt or a chat; let the tool read it from an environment variable.2
  • Read-only access. A market data API that only reads cannot move funds or change anything, whatever the model does with it.
  • Data is data, not instructions. Text fields such as news headlines come from outside. An agent should treat them as content to report, not as commands to follow.
  • Facts, not advice. Our suggested agent instructions ask the model to report facts only and never to turn the data into buy or sell advice.2

A minimal setup

The AI agents page has a system prompt that works as a starting point. In short, it tells the agent:

  1. Where the API is and where the full reference lives, to be read before the first call.
  2. How to authenticate: a key from the environment, or the public header.
  3. To state the data time and credit the sources from the answer.
  4. To report facts only.

From there, the agent can call endpoints such as the funding board, the liquidation summary or a coin's heatmap. The guides Crypto liquidation data API and Funding rate and open interest API show which endpoint answers which question, and WebSocket vs REST for market data covers live streams.

Common questions

Can an AI agent read Blockmetric data without an account? Yes, through the public tier with the access header, within its history window and limits.

Is the MCP server available? Yes. Add https://api.blockmetric.io/mcp as a remote MCP server in ChatGPT, Claude.ai or any MCP client, or run the local package with npx -y blockmetric-mcp. It works without a key through public access; the REST API, the OpenAPI document and the Markdown reference work for agents as well.

Should the agent show raw numbers? Yes, with their time and units. Rounding and translating fractions into percentages is fine, as long as the time and source stay attached.

Next steps

Live data

See today’s numbers

The live pages update continuously.

Set up an agent

Free plan: every coin, up to 30 days of history. Compare plans

Sources

  1. llms.txt, "The /llms.txt file" (proposal) (accessed 2026-11-11)Back to text
  2. Blockmetric API reference, "AI agents and LLMs" (accessed 2026-11-11)Back to text
  3. OpenAPI Initiative, "OpenAPI Specification v3.1.0" (accessed 2026-11-11)Back to text
  4. Model Context Protocol, "Specification" (2025-06-18) (accessed 2026-11-11)Back to text
  5. Blockmetric API reference, "Conventions and glossary" (accessed 2026-11-11)Back to text

How we collect and check the data: Data & methodology.

Share this guide as a link or as an image card with its title.

LiveHyperliquid markets 31sOperationalHyperliquid positions & whales 10sOperationalLiquidation heatmap & levels 19sOperationalLighter markets & liquidations 28sOperationalLighter positions & heatmap 25sOperationalLighter on Robinhood Chain: positions & heatmap 21sOperationalAster markets 41sOperationalBinance markets 54sOperationalBybit markets 47sOperationalGate markets 50sOperationalHTX markets 36sOperationalKuCoin markets 49sOperationalBinance liquidations 25sOperationalBybit liquidations 25sOperationalGate liquidations 24sOperationalHTX liquidations 25sOperationaldYdX positions & heatmap 26sOperationalGMX positions & heatmap 16sOperationalLong/short & open interest history 44sOperationalOrder books & trade flow 17sOperationalOn-chain transfers 10sOperationalSecurity monitor 29sOperationalBlockmetric Sentiment 8mOperationalAgency releases 3mOperationalAlert delivery 18sOperationalDataset files 28mOperational16:36:08 UTC