← toolvend APIs

Quote first. Pay once.

The public Node client requests a real x402 quote for the VAT endpoint and prints it. Its default mode cannot sign or spend.

1. Get a quote

Requires Node.js 20 or newer. This step needs no wallet and installs no packages.

curl -fsS https://toolvend.dev/quickstart/client.mjs -o toolvend-client.mjs
node toolvend-client.mjs

2. Make one capped payment

Use a Base mainnet wallet that holds USDC. Base payments are gas-sponsored, so the buyer does not need ETH. The service also supports and prefers USDC on Solana; this first runnable client intentionally supports Base only.

npm install @x402/core@2.19.0 @x402/evm@2.19.0 viem@2.55.4
read -rsp 'Base buyer private key: ' TOOLVEND_BUYER_PRIVATE_KEY && echo
export TOOLVEND_BUYER_PRIVATE_KEY
node toolvend-client.mjs --pay --max-spend 0.002
unset TOOLVEND_BUYER_PRIVATE_KEY
Payment is disabled unless both --pay and --max-spend are present. The client pins toolvend's origin, Base network, USDC contract, and recipient; signs one authorization; sends one paid retry; and never retries a failed or ambiguous payment.

Choose another GET endpoint

Pass a relative path from the live catalogue. The client rejects other origins and routes that are not active GET endpoints.

node toolvend-client.mjs --path '/qr?data=https%3A%2F%2Fexample.com&size=256'

Responses are printed as text using their declared content type, including QR SVG output.

Quote and buy a POST endpoint

Pass one JSON object to quote an active POST route. This static extraction quote does not read a wallet:

node toolvend-client.mjs --path '/extract' --json '{"url":"https://example.com"}'

After reviewing the quote, add an explicit cap to buy the same request once:

node toolvend-client.mjs --path '/extract' --json '{"url":"https://example.com"}' --pay --max-spend 0.01

JavaScript rendering costs $0.03 instead of the $0.01 static extraction price. Choose it with ?render=true and raise the cap to the quoted price:

node toolvend-client.mjs --path '/extract?render=true' --json '{"url":"https://example.com"}' --pay --max-spend 0.03

Connect over MCP

Add the Streamable HTTP server to an MCP client that supports remote servers. Tool calls return an x402 challenge in an error-marked tool result; an x402-capable client pays and retries with _meta["x402/payment"].

{
  "mcpServers": {
    "toolvend": {
      "url": "https://toolvend.dev/mcp"
    }
  }
}

Safety behavior