$METERLYon Robinhood Chain
Docs

Build with Meterly.

Everything you need to give an agent a balance, set its limits and read its record.

Quickstart

Meterly speaks the OpenAI API format, so most agents only need a new base URL and key. This takes about five minutes.

  1. Request access and create an agent in the dashboard. You get a key that starts with mtr_live_.
  2. Fund the balance with a card or USDC. Five dollars is enough to try everything here.
  3. Point your client at Meterly and make a call.
client.ts
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.meterly.cc/v1",
  apiKey: process.env.METERLY_API_KEY,
});

const res = await client.chat.completions.create({
  model: "meterly/auto",
  messages: [{ role: "user", content: "Summarize this ticket" }],
});

The response is a normal chat completion. Every call also returns a meterly-receipt-id header that points at its signed receipt.

Authentication

Send your key as a bearer token on every request. Each agent has its own key, so spending and receipts stay separate.

terminal
curl https://api.meterly.cc/v1/me \
  -H "Authorization: Bearer $METERLY_API_KEY"
Keep keys server-side. A key can spend the agent's balance up to its limits. Rotate a key from the dashboard at any time; the old one stops working immediately.

Models and routing

Pass any model ID from the pricing page in the model field, or pass meterly/auto and let the router choose.

The router reads the request, estimates how hard it is and sends it to the cheapest model that has handled similar requests reliably. You can bound it:

request.json
{
  "model": "meterly/auto",
  "meterly": {
    "min_tier": "general",
    "max_cost_per_call": 0.05
  },
  "messages": [ ... ]
}

Auto routing keeps 30% of what it saves against the top model and nothing when it routes to the top model. The picked model is returned in the model field of the response.

Spending limits

Limits are set by the account owner and can't be changed with an agent key. A call that would break a limit fails with 402 limit_exceeded and costs nothing.

LimitWhat it does
daily_capMaximum total spend per UTC day.
max_per_paymentLargest single charge, including tool payments.
allowed_payeesTools and agents this agent may pay. Empty means none.
allowed_modelsModels it may call. Empty means all.
loop_breakerStops identical calls repeated more than N times in a minute.
pausedBlocks every paid call until switched off.
terminal
curl -X PUT https://api.meterly.cc/v1/agents/researcher-01/limits \
  -H "Authorization: Bearer $METERLY_OWNER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"daily_cap":10,"max_per_payment":0.5,"loop_breaker":20}'

Funding

Every agent draws from its own balance. Top up from the dashboard or the API.

  • Card or Apple Pay: $5 to $1,000 per top-up, 2.9% + $0.30.
  • USDC: send to the agent's deposit address. Arrives in about a minute, no Meterly fee.
  • Vault interest: interest on vault deposits is credited automatically.

Credits don't expire. Unused balance can leave as mCREDIT, with a fixed 2% cash-out fee.

Receipts and records

Each paid call produces a receipt with the agent ID, model or tool, token counts, cost and a timestamp. Prompts and replies are never part of it.

  1. Every call: the receipt is signed with Meterly's key.
  2. Every hour: a Merkle root of that hour's receipts is written onchain.
  3. Every day: a statement with totals is filed to the agent's ERC-8004 entry.
terminal
curl https://api.meterly.cc/v1/records/researcher-01

Records are public by agent ID and need no key. An agent moves up the rungs (New, Active, Steady, Earning, Established) as it builds sealed history without disputes.

Selling a tool

Any HTTP API can be listed. Agents find it with find_tools and pay per call from their balance. Listing is free and Meterly keeps 1.5% of what you earn.

  1. Describe the endpoint, its inputs and its price per call.
  2. Meterly calls it on the agent's behalf and charges only when it returns a 2xx response.
  3. Earnings land on your balance and can be withdrawn or kept in the vault.

Errors

StatusCodeMeaning
401invalid_keyThe key is missing, wrong or rotated.
402insufficient_balanceTop up the agent's balance and retry.
402limit_exceededA spending limit blocked the call. Nothing was charged.
429rate_limitedToo many requests. Wait for the retry-after header.
502upstream_errorThe model or tool failed. Paid tool calls are refunded.