x402 · HTTP 402 Payment Required

Your module earns while you sleep.

Every AI agent that hits your module pays over HTTP 402. No signup. No brand trust. Just a 200. 70% goes to you, forever.

Register an agent → See the code

How it works

One round trip between the agent and MeterCall. No off-chain invoicing, no monthly reconciliation, no vendor portal logins.

Step 1

Agent calls a module

POST /v1/module/{slug}/call with payload and agent ID.

Step 2

402 Payment Required

We respond with price, asset, chain, and a one-shot invoice nonce.

Step 3

Agent signs & retries

Agent retries with an X-PAYMENT header containing the signed payload.

Step 4

200 OK + receipt

Module runs. We return the data and a settlement receipt hash.

Code sample

Three languages, one protocol. Drop this into any agent framework — LangChain, CrewAI, AutoGen, bare HTTP, whatever you ship with.

# 1. Initial call — receives 402
curl -X POST https://api.metercall.ai/v1/module/stock-quote/call \
  -H "X-Agent-ID: agt_7Zf2kQ" \
  -d '{"ticker":"NVDA"}'

# Response:
# HTTP/1.1 402 Payment Required
# X-Payment-Required: {"price":"0.001","asset":"USDC",
# "chain":"base","nonce":"inv_8ab3","to":"0xMC...a1"}

# 2. Agent signs, retries with X-PAYMENT header
curl -X POST https://api.metercall.ai/v1/module/stock-quote/call \
  -H "X-Agent-ID: agt_7Zf2kQ" \
  -H "X-PAYMENT: eyJzaWciOiIweGFiMTIuLi4iLCJub25jZSI6ImludjhhYjMifQ==" \
  -d '{"ticker":"NVDA"}'

# Response: 200 OK
# { "price": 892.14, "ts": 1713200000, "receipt": "0xrcp...9f" }
from metercall import AgentClient

client = AgentClient(
    agent_id="agt_7Zf2kQ",
    wallet="cdp://base/0xAgent...f3",   # Coinbase CDP
    spend_cap_usd=25.00,                 # daily cap
)

# Handles the 402 handshake + X-PAYMENT automatically
result = client.call("stock-quote", {"ticker": "NVDA"})

print(result.data)       # {"price": 892.14, ...}
print(result.receipt)    # "0xrcp...9f"
print(result.cost_usd)   # 0.001
import { MeterCall } from "@metercall/agent"

const mc = new MeterCall({
  agentId: "agt_7Zf2kQ",
  wallet: "thirdweb://base/0xAgent...f3",  // Thirdweb Engine
  spendCapUsd: 25.00,
})

// Auto-handles HTTP 402, signs payload, retries
const { data, receipt, costUsd } = await mc.call(
  "stock-quote",
  { ticker: "NVDA" }
)

console.log(data)     // { price: 892.14, ... }
console.log(receipt)  // "0xrcp...9f"

Supported rails

Pick the settlement layer your agent already has a wallet on. We meet you there.

USDC

USDC on Base

Native x402. Sub-second finality, gas under a penny, Coinbase CDP wallets supported out of the box. Default for most agents.

Recommended
ETH

ETH on Mainnet

For agents with existing Ethereum wallets. Higher gas; we batch settlement every 60 seconds to keep costs under 1%.

Supported
API

Stripe API key

Non-crypto agents can pay with a Stripe secret key bound to the agent. Good for cloud orchestrators and serverless runners.

Supported
VC

Virtual Cards

Lithic or Stripe Issuing. Mint a single-use card with a spending cap per agent. Full audit trail, no crypto touched.

Supported

Register your agent

Give your agent an identity and a spending cap. Takes 30 seconds. Cap is enforced at our edge — you cannot overspend.

New agent

You get back an agt_* ID and a first-load of Meter credits.

Internal label. Shows up in audit logs and alerts.
Base, Mainnet, or CDP wallet URI. Leave blank to use Stripe.
$1 = 1M Meter credits. Redirects to Stripe.