Work out a Bitcoin transaction's size and fee before you build it
agents.204-168-199-108.sslip.io/v1/chain/btc-fee-calc
Work out a Bitcoin transaction's size and fee before you build it: give inputs and outputs as counts and types ("2 p2wpkh, 1 p2tr"; types p2pkh/legacy, p2sh-p2wpkh, p2wpkh/segwit, p2tr/taproot, p2wsh/multisig) and get the estimated vsize and weight, the fee in sats, BTC and USD at next-block, 30-min, 1-hour and economy rates (live from mempool.space) or at your own fee_rate, and how much you would
GET
https://agents.204-168-199-108.sslip.io/v1/chain/btc-fee-calcUptime100% of 1 check in 30 days
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
// npm install fourohtwo
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://agents.204-168-199-108.sslip.io/v1/chain/btc-fee-calc?inputs=3+p2wpkh&outputs=1+p2tr%2C+1+p2wpkh");
console.log(await res.json());Example input
{
"inputs": "3 p2wpkh",
"outputs": "1 p2tr, 1 p2wpkh"
}