v2.0 — Agent API

Lightning payments
for machines

Without the Lightning complexity

Mintbot gives AI agents a Bitcoin wallet in seconds. Fund via Lightning, pay other agents instantly with zero fees, or pay any Lightning address worldwide.

from mintbot import AgentWallet

# Create a wallet once — save the key!
wallet = AgentWallet.create(agent_name="my-agent")
print(wallet.api_key)  # mb_live_... — store securely

# Load it next time
wallet = AgentWallet(api_key="mb_live_...")

# Check balance
print(wallet.balance)  # 950 sats

# Pay another agent — instant, zero fees
result = wallet.pay(to_wallet="w_xyz789", amount=50)
print(result.new_balance_sats)  # 900
import { MintbotWallet } from 'mintbot-sdk';

// Create a wallet once — save the key!
const wallet = await MintbotWallet.create({
  baseUrl: 'https://api.mintbot.cash',
  agentName: 'my-agent',
});
console.log(wallet.apiKey);  // mb_live_...

// Load it next time
const wallet = new MintbotWallet({ apiKey: 'mb_live_...' });

// Check balance
const balance = await wallet.getBalance();  // 950

// Pay another agent — instant, zero fees
const result = await wallet.pay({ toWallet: 'w_xyz789', amount: 50 });
console.log(result.newBalanceSats);  // 900

Agent Wallets

Each agent gets an isolated wallet with its own API key, balance, and optional spending cap.

Internal Payments

Agent-to-agent transfers settle instantly with zero fees — no Lightning routing involved.

Lightning In / Out

Fund wallets by generating a BOLT11 invoice. Send to any Lightning address or invoice worldwide.

L402 Pay-per-Request

Proxy any HTTP API behind a Cashu paywall. Monetize your endpoints for machine clients.

Cashu Tokens

Withdraw funds as portable, offline-redeemable Cashu ecash tokens. No counterparty risk.

Full Audit Trail

Every payment is recorded. Query your transaction history with filtering and pagination.

Getting Started

From zero to your first payment in under 5 minutes.

01

Create a wallet

No account needed — generate a wallet via API. Save the api_key; it's shown exactly once.

curl
curl -X POST https://api.mintbot.cash/agent/wallet/create \
  -H "Content-Type: application/json" \
  -d '{
    "agent_name": "my-agent",
    "budget_sats": 10000
  }'
Response
{
  "wallet_id": "w_a1b2c3d4e5f6g7h8",
  "api_key": "mb_live_00112233445566778899aabbccddeeff",
  "api_key_prefix": "mb_live_0011223",
  "mint_url": "https://mint.mintbot.cash",
  "balance_sats": 0,
  "agent_name": "my-agent",
  "budget_limit_sats": 10000,
  "lightning_address": "my-agent@mintbot.cash",
  "warning": "Store your api_key securely — it will not be shown again."
}
02

Install the SDK

Python
pip install mintbot
TypeScript
npm install mintbot-sdk
CLI
npm install -g @mintbot/cli
mintbot config set --api-key "mb_live_..."
03

Fund your wallet

Generate a Lightning invoice and pay it from any Lightning wallet. You can also send sats directly to fund@mintbot.cash from any Lightning wallet — no API call needed.

curl
curl https://api.mintbot.cash/agent/wallet/fund \
  -H "Authorization: Bearer mb_live_..." \
  -H "Content-Type: application/json" \
  -d '{"method": "lightning", "amount_sats": 1000}'
Response
{
  "method": "lightning",
  "bolt11": "lnbc10u1pjzzz...",
  "quote_id": "abc123...",
  "amount_sats": 1000,
  "status": "UNPAID",
  "wallet_id": "w_a1b2c3d4e5f6g7h8",
  "note": "Pay the invoice. Balance credits automatically when confirmed."
}
04

Make your first payment

Pay another agent wallet instantly — zero fees, instant settlement.

curl
curl -X POST https://api.mintbot.cash/agent/pay \
  -H "Authorization: Bearer mb_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "to_wallet": "w_recipient123",
    "amount_sats": 50,
    "memo": "payment for service"
  }'
Response
{
  "success": true,
  "tx_id": 42,
  "from_wallet": "w_a1b2c3d4e5f6g7h8",
  "to_wallet": "w_recipient123",
  "amount_sats": 50,
  "tx_type": "internal",
  "memo": "payment for service",
  "status": "completed",
  "new_balance_sats": 950
}

Ready to build?

Full API reference, SDK docs, and concept guides.