x402-price-check

An inference endpoint answers 402 Payment Required with an x402 quote. Before your agent pays, check it against what justweight lists for the same model and token count, under your max premium and budget.

GitHub · Budget by agent-spendcap · Reads x402 v2 and v1 (spec @ 0e6e8c5) · Never signs or pays

Try it

npx -y github:xbtMelchizedek/x402-price-check demo

A local mock x402 endpoint quotes list price +10% and then 3x list. The first is paid with a mock payment and the second is refused before anything is sent. To check a real endpoint's quote without paying: npx -y github:xbtMelchizedek/x402-price-check probe <url> --body request.json.

Check a quote here

Paste a PAYMENT-REQUIRED header value, a v1 402 body, a PaymentRequired object or an MCP tool result. Everything runs on this page; nothing is sent anywhere.

Loading justweight prices…

How the check works

  1. Quote in USD. Each exact or upto option is priced only if its asset is in x402's own table of USD-pegged default assets (42 on 32 networks). Fiat codes, unknown tokens and other schemes stay unpriced, with the reason. The cheapest priced option is checked.
  2. List price. justweight's cost for the same model at your input tokens and max output, at the cheapest listing or the median. Batch-only tiers are skipped.
  3. Premium. (quote − list) / list, rounded up. Over your max premium is a reject. A model justweight doesn't list is a reject.
  4. Budget. In the CLI, library and MCP tool, an approved quote must also pass an agent-spendcap policy and places a hold. This page has no budget.
Quote fromSpecField
PAYMENT-REQUIRED header (base64)x402 v2 (v2.0, 2025-12-9)accepts[].amount
402 JSON bodyx402 v1accepts[].maxAmountRequired
MCP tool resulttransports-v2/mcp.mdstructuredContent

As an MCP tool

{ "mcpServers": { "x402-price-check": { "command": "npx",
  "args": ["-y", "github:xbtMelchizedek/x402-price-check", "mcp", "--max-day", "1"] } } }

Tools: x402_price_check, x402_settle, x402_release, x402_budget. Part of the agent inference kit.