MeterX402

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

Visit Repo
MeterX402 banner

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:

  • Runs the API request.
  • Measures the returned units.
  • Holds the response.
  • Returns `402 Payment Required` with the exact price.
  • Ties the price to a hash of the response.
  • Lets the buyer's wallet verify the price against its budget.
  • Releases the response after payment.
  • 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.

From the public ETHGlobal showcase page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

QuietLast push 82 days ago

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.