Buy prepaid credits (Lightning or USDC)
buy_creditsUse this when you will make many calls or run feeds and want to pay once instead of per call. Omit credit_token to open a new account: the result includes a btf_ token shown ONCE, store it. Lightning: pass bundle or amount_sats (100 to 1,000,000) to get an invoice, pay it, then call again with payment_hash and credit_token to credit it. USDC on Base (x402): pass bundle or amount_usd (0.10 to 50), sign accepts[0], call again with the same amount plus x402_payment; USDC is settled before crediting. Sats pay sats prices, USDC pays USDC list prices; spend with credit_token on any paid tool. Credits are NON-REFUNDABLE; a call that fails is refunded to the balance. Paused feeds resume after credit.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "buy_credits"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bundle | No | A preset amount; see get_pricing for the sats and USD of each. | |
| currency | No | With bundle: which currency to pay in. | sats |
| amount_usd | No | USDC over x402: dollars to add (0.10 to 50), e.g. "1.00". | |
| amount_sats | No | Lightning: sats to add (100 to 1,000,000). Alternative to bundle. | |
| credit_token | No | Prepaid token (btf_...), returned once by buy_credits or create_feed. Send it on every later feed or credit call. | |
| payment_hash | No | Lightning: check this invoice and credit it if paid, instead of creating a new one. | |
| x402_payment | No | x402 payment (USDC on Base): base64 PaymentPayload signed for accepts[0] of the payment_required result. Alternative to l402_credential; also accepted in params._meta['x402/payment']. |