Search projects, hackathons, sponsors and tech

    ← All projects

    MeterX402

    Turn any API, dataset or AI agent into a pay-per-use Hedera x402 service in seconds

    Demo

    About

    # MeterX402 **Turn any API into a metered x402 API.** Buyers pay for exactly what each call returns, not a flat price per request. --- ## The Problem x402 enables APIs to charge per request, but a request is often the wrong unit of pricing. - A 5-word AI response and a 5-page response cost the same. - A 1-day weather forecast and a 7-day forecast cost the same. Sellers therefore have to price for the worst case, and light users overpay. This is especially painful for AI agents, which make many small API calls. --- ## One npm Package ```bash npx mx402 publish <url> --wallet <account> ``` MeterX402: - Calls the API once and reads its response. - Automatically determines what should be metered: - **Tokens** for LLMs - **Rows** for lists - **Entities** for GraphQL - Suggests a price based on the measured unit. - Starts a payment gateway in front of the API. - Registers the service in a searchable registry for agents. No code changes required. Your upstream API key never leaves your machine. --- ## Pay for Exactly What You Get The gateway: 1. Runs the API request. 2. Measures the returned units. 3. Holds the response. 4. Returns `402 Payment Required` with the exact price. 5. Ties the price to a hash of the response. 6. Lets the buyer's wallet verify the price against its budget. 7. Releases the response after payment. 8. Returns a receipt that anyone can verify on-chain. --- ## Sell Datasets Too ```bash npx mx402 data file.csv ``` Turn a CSV, JSON, or JSONL file into a queryable API priced per cell. - Schema is free. - Row count is free. - The original file stays on your machine. --- ## Sell AI Agents Point `mx402 publish` at an LLM or your own agent endpoint. - Price the agent per token. - Stream responses through Metered Tabs. - Generate an A2A agent card. - Create a Hedera HCS-14 identity. --- ## Multi-Chain Settlement One flag determines where payments settle: | Hedera | Base Sepolia | Solana Devnet --- ## One Dashboard The Deployer page shows: - Income, paid calls, and units sold. - Price of every call. - How much buyers saved compared with flat pricing. - Every payment with its blockchain explorer link. - A service registry with reputation scores based on real settlements. Reputation data is anchored to Hedera Consensus Service. --- ## Onchain Data ### The Graph - One query across 15 standardized DEX subgraphs. - One query across 15 lending subgraphs. - Arbitrary GraphQL queries against any subgraph. - Payment per result. - No Graph API key required. - Failed queries cost nothing. ### Uniswap - Uniswap Trading API quotes are sold per call. --- ## The DEX Analyst An AI agent that pays for its own research. - Performs four paid research steps. - Returns four payment receipts. - Only reports numbers that it actually paid to retrieve. - Can build a Uniswap swap transaction for the user's wallet without ever submitting the transaction. --- ## Use It From the AI You Already Have MeterX402 connects to: - **Claude** - **VS Code** — Copilot or our extension - **ChatGPT** Setup takes only a few steps. Each AI agent pays using the user's own testnet account, directly from their machine and within their configured budget. --- ## The Vision Machines pay machines directly. No signup. No API key. No human approval for every call.

    How it's made

    # MeterX402 — How It Works ## Flow 1. **Publish.** The seller runs `npx mx402 publish <url> --wallet <account>`. It calls the API once, reads the response, and detects what to meter — tokens, rows at a JSON path, cells, entities, bytes — along with a starting price. 2. **Gateway up.** It starts a gateway in front of the API. The seller's upstream key is injected server-side and never reaches buyers. `mx402 data file.csv` does the same for a dataset, priced per cell. 3. **Meter, then quote.** When a buyer calls, the gateway runs the request first, counts the units, holds the body, and replies `402 Payment Required` with the exact price and a SHA-256 of that body. 4. **Pay.** The buyer's client checks the price against its budget and signs one x402 payment. A settlement adapter sends it to the right facilitator for the chain. 5. **Release.** After settlement the same body is released with a receipt. Every event streams to the hub, which runs the registry, reputation scores, analytics, and the web app (marketplace, Try it, Playground, Deployer dashboard). 6. **Plug in.** AI clients connect three ways: an MCP server with 12 tools (Claude, Copilot, Cursor) via the `mx402` connector; a REST API with an OpenAPI spec behind a bearer token (ChatGPT Custom GPT Actions); and a VS Code extension. All of them sign with the user's own key, never a shared wallet. --- ## Partner Technologies ### Hedera (default settlement) - Payments settle through the **blocky402** facilitator in HBAR or HTS tokens. - Hedera Consensus Service stores a public receipt for every payment and anchors reputation evidence, so the dashboard is auditable. - Native allowances power **Metered Tabs**: a buyer approves once and an LLM answer streams token by token, settled in batches. - Scheduled transactions power cancellable subscriptions. - Every service gets an HCS-14 agent ID. - The mirror node verifies every transfer. ### The Graph - Messari's standardized schemas let one query cover 15 DEX subgraphs and another cover 15 lending subgraphs, across chains, in one shape. That is what makes the analyst's "lend or provide liquidity?" comparison possible. - A circuit breaker drops slow indexers, and Uniswap's own v3 subgraph answers when a standardized one fails. - Any subgraph can be queried and paid per entity, with no Graph key for the buyer. - 4 MCP tools and a `SKILL.md` make it usable by any agent. ### Uniswap - Trading API `/quote`, `/check_approval` and `/swap` are sold per call. - Our swap builder turns a quote into the approval, a signed Permit2 message, and swap calldata (classic routes and UniswapX) — never broadcast. ### Base and Solana - USDC through x402.org: EIP-3009 on Base, SPL transfers on Solana. --- when used, so `npx mx402` starts fast.