Bitcoin forAI agents.
A Lightning wallet your agent uses from the CLI, over MCP or through the API. It can pay, get paid and charge for its own API.
Try it here: type lnbot init in and you have a wallet.
A Lightning wallet your agent uses from the CLI, over MCP or through the API. It can pay, get paid and charge for its own API.
Try it here: type lnbot init in and you have a wallet.
One command creates a wallet, its API key and a Lightning address that any Lightning wallet can pay. We run the nodes and the channels.
The MCP server is built in. Any AI model discovers the payment tools on its own, without custom integration: Claude, Cursor, or an agent of your own.
Payments between ln.bot wallets settle in under a second and cost nothing. Receiving from any Lightning wallet is free too.
Amounts follow BIP 177: ₿1 is one sat, the smallest unit of bitcoin.
SDKs for TypeScript, Python, Go, Rust and C#, plus the CLI and plain HTTP. Each tab makes the same two calls: create an invoice, then pay another agent.
# Create an invoice
$ lnbot invoice create --amount 1000 --memo "AI task"
Amount: ₿1,000
BOLT11:
lnbc10u1pn...
# Pay another agent
$ lnbot pay r7vq3np@ln.bot --amount 500
✓ Payment settled: -₿500
Fee: ₿0curl -fsSL https://ln.bot/install.sh | bashimport { LnBot } from "@lnbot/sdk"
const ln = new LnBot({ apiKey: "uk_..." })
const w = ln.wallet("wal_...")
// Create an invoice
const inv = await w.invoices.create({ amount: 1000 })
console.log(inv.bolt11)
// Pay another agent
await w.payments.create({ target: "r7vq3np@ln.bot", amount: 500 })npm install @lnbot/sdkfrom lnbot import LnBot
ln = LnBot(api_key="uk_...")
w = ln.wallet("wal_...")
# Create an invoice
inv = w.invoices.create(amount=1000)
print(inv.bolt11)
# Pay another agent
w.payments.create(target="r7vq3np@ln.bot", amount=500)pip install lnbotimport lnbot "github.com/lnbotdev/go-sdk"
ln := lnbot.New("uk_...")
w := ln.Wallet("wal_...")
// Create an invoice
inv, _ := w.Invoices.Create(ctx, &lnbot.CreateInvoiceParams{
Amount: 1000,
})
fmt.Println(inv.Bolt11)
// Pay another agent
w.Payments.Create(ctx, &lnbot.CreatePaymentParams{
Target: "r7vq3np@ln.bot",
Amount: lnbot.Ptr(int64(500)),
})go get github.com/lnbotdev/go-sdkuse lnbot::{LnBot, CreateInvoiceRequest, CreatePaymentRequest};
let ln = LnBot::new("uk_...");
let w = ln.wallet("wal_...");
// Create an invoice
let inv = w.invoices().create(
&CreateInvoiceRequest::new(1000)
).await.unwrap();
println!("{}", inv.bolt11);
// Pay another agent
w.payments().create(
&CreatePaymentRequest::new("r7vq3np@ln.bot").amount(500)
).await.unwrap();cargo add lnbotusing LnBot;
using LnBot.Models;
using var client = new LnBotClient("uk_...");
var w = client.Wallet("wal_...");
// Create an invoice
var inv = await w.Invoices.CreateAsync(new CreateInvoiceRequest
{
Amount = 1000,
});
Console.WriteLine(inv.Bolt11);
// Pay another agent
await w.Payments.CreateAsync(new CreatePaymentRequest
{
Target = "r7vq3np@ln.bot",
Amount = 500,
});dotnet add package LnBot# Create an invoice
curl -X POST https://api.ln.bot/v1/wallets/wal_.../invoices \
-H "Authorization: Bearer uk_..." \
-H "Content-Type: application/json" \
-d '{"amount": 1000, "memo": "AI task"}'
# Pay another agent
curl -X POST https://api.ln.bot/v1/wallets/wal_.../payments \
-H "Authorization: Bearer uk_..." \
-H "Content-Type: application/json" \
-d '{"target": "r7vq3np@ln.bot", "amount": 500}'Put a price on any route with L402 middleware. A caller gets HTTP 402 with an invoice, pays it and retries with proof of payment, and each payment buys one request. Your customers need no account, and you hand out no API keys.
import express from "express"
import { l402, LnBot } from "@lnbot/l402"
const app = express()
const ln = new LnBot({ apiKey: "uk_..." })
// Paywall any route: ₿10 per request
app.use("/api/premium", l402.paywall(ln, {
walletId: "wal_...",
price: 10,
description: "API access"
}))
app.get("/api/premium/data", (req, res) => {
res.json({ data: "premium content" })
})npm install @lnbot/l402using LnBot;
using LnBot.L402;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSingleton(new LnBotClient("uk_..."));
var app = builder.Build();
// Paywall any route: ₿10 per request
app.UseL402Paywall("/api/premium", new L402Options
{
WalletId = "wal_...",
Price = 10,
Description = "API access"
});
app.MapGet("/api/premium/data", () =>
Results.Ok(new { data = "premium content" })
);dotnet add package LnBot.L402.AspNetCoreMoving bitcoin between ln.bot wallets is free, and so is receiving it from anywhere on Lightning. Sending it out to Lightning costs 0.25%, at least ₿1, plus the routing fee. You see both before you pay. There's no subscription and no tier to pick.
██╗ ███╗ ██╗ ██████╗ ██████╗ ████████╗ ██║ ████╗ ██║ ██╔══██╗██╔═══██╗╚══██╔══╝ ██║ ██╔██╗ ██║ ██████╔╝██║ ██║ ██║ ██║ ██║╚██╗██║ ██╔══██╗██║ ██║ ██║ ███████╗██║ ╚████║██╗██████╔╝╚██████╔╝ ██║ ╚══════╝╚═╝ ╚═══╝╚═╝╚═════╝ ╚═════╝ ╚═╝
# Create an invoice
$ lnbot invoice create --amount 1000 --memo "AI task"
Amount: ₿1,000
BOLT11:
lnbc10u1pn...
# Pay another agent
$ lnbot pay r7vq3np@ln.bot --amount 500
✓ Payment settled: -₿500
Fee: ₿0curl -fsSL https://ln.bot/install.sh | bashimport { LnBot } from "@lnbot/sdk"
const ln = new LnBot({ apiKey: "uk_..." })
const w = ln.wallet("wal_...")
// Create an invoice
const inv = await w.invoices.create({ amount: 1000 })
console.log(inv.bolt11)
// Pay another agent
await w.payments.create({ target: "r7vq3np@ln.bot", amount: 500 })npm install @lnbot/sdkfrom lnbot import LnBot
ln = LnBot(api_key="uk_...")
w = ln.wallet("wal_...")
# Create an invoice
inv = w.invoices.create(amount=1000)
print(inv.bolt11)
# Pay another agent
w.payments.create(target="r7vq3np@ln.bot", amount=500)pip install lnbotimport lnbot "github.com/lnbotdev/go-sdk"
ln := lnbot.New("uk_...")
w := ln.Wallet("wal_...")
// Create an invoice
inv, _ := w.Invoices.Create(ctx, &lnbot.CreateInvoiceParams{
Amount: 1000,
})
fmt.Println(inv.Bolt11)
// Pay another agent
w.Payments.Create(ctx, &lnbot.CreatePaymentParams{
Target: "r7vq3np@ln.bot",
Amount: lnbot.Ptr(int64(500)),
})go get github.com/lnbotdev/go-sdkuse lnbot::{LnBot, CreateInvoiceRequest, CreatePaymentRequest};
let ln = LnBot::new("uk_...");
let w = ln.wallet("wal_...");
// Create an invoice
let inv = w.invoices().create(
&CreateInvoiceRequest::new(1000)
).await.unwrap();
println!("{}", inv.bolt11);
// Pay another agent
w.payments().create(
&CreatePaymentRequest::new("r7vq3np@ln.bot").amount(500)
).await.unwrap();cargo add lnbotusing LnBot;
using LnBot.Models;
using var client = new LnBotClient("uk_...");
var w = client.Wallet("wal_...");
// Create an invoice
var inv = await w.Invoices.CreateAsync(new CreateInvoiceRequest
{
Amount = 1000,
});
Console.WriteLine(inv.Bolt11);
// Pay another agent
await w.Payments.CreateAsync(new CreatePaymentRequest
{
Target = "r7vq3np@ln.bot",
Amount = 500,
});dotnet add package LnBot# Create an invoice
curl -X POST https://api.ln.bot/v1/wallets/wal_.../invoices \
-H "Authorization: Bearer uk_..." \
-H "Content-Type: application/json" \
-d '{"amount": 1000, "memo": "AI task"}'
# Pay another agent
curl -X POST https://api.ln.bot/v1/wallets/wal_.../payments \
-H "Authorization: Bearer uk_..." \
-H "Content-Type: application/json" \
-d '{"target": "r7vq3np@ln.bot", "amount": 500}'import express from "express"
import { l402, LnBot } from "@lnbot/l402"
const app = express()
const ln = new LnBot({ apiKey: "uk_..." })
// Paywall any route: ₿10 per request
app.use("/api/premium", l402.paywall(ln, {
walletId: "wal_...",
price: 10,
description: "API access"
}))
app.get("/api/premium/data", (req, res) => {
res.json({ data: "premium content" })
})npm install @lnbot/l402using LnBot;
using LnBot.L402;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSingleton(new LnBotClient("uk_..."));
var app = builder.Build();
// Paywall any route: ₿10 per request
app.UseL402Paywall("/api/premium", new L402Options
{
WalletId = "wal_...",
Price = 10,
Description = "API access"
});
app.MapGet("/api/premium/data", () =>
Results.Ok(new { data = "premium content" })
);dotnet add package LnBot.L402.AspNetCoreInteractive
Install the CLI, run lnbot init, and your AI agent has access to Bitcoin.
Rather not install anything yet?
ln.bot is a Bitcoin Lightning wallet built for AI agents. Agents use it from the CLI, over MCP, through the REST API or with SDKs in five languages, to send and receive bitcoin and to charge for their own APIs with L402.
Agents connect via MCP (Model Context Protocol), REST API, or CLI. They get a wallet with an API key and can create invoices, make payments, and check balances through standard tool calls.
No. ln.bot runs the Lightning nodes, manages channel liquidity and handles routing. You make API calls; there is no node to run and no channels to manage.
Install the CLI and run lnbot init, or use Get API key on this page. Either way you get an account, a wallet with its own Lightning address, an API key and a recovery passphrase. There is no signup form and no identity check.
Transfers between ln.bot wallets are free. Outbound Lightning payments cost 0.25% (minimum ₿1) plus the routing fee. The API, the CLI and MCP quote both before you pay. Receiving from Lightning is free. No subscriptions or monthly fees.
We write amounts the way BIP 177 proposes: the ₿ sign and a whole number of Bitcoin's smallest unit, the one long called a satoshi, or sat. ₿1,000 is 1,000 of those units, which is 0.00001 BTC in the old notation. The API works in the same whole units.
Yes. Every wallet gets an address like x4k7m2@ln.bot that any Lightning wallet in the world can pay. You can also claim a vanity name@ln.bot: ₿100 for five characters or more, ₿1,000 for four, ₿10,000 for three.
ln.bot exposes an MCP server at api.ln.bot/v1/wallets/{walletId}/mcp using streamable HTTP transport. AI clients discover it via ln.bot/.well-known/mcp.json. Tools include create_invoice, quote_payment, send_payment, get_wallet, list_invoices, list_payments, list_transactions, and list_addresses.
There are SDKs for TypeScript, Python, Go, Rust and C#, plus the lnbot CLI, the REST API and the MCP server. L402 middleware is available for Express (TypeScript) and ASP.NET Core (C#).
Yes. The L402 middleware puts a price on any route. A client that calls it gets HTTP 402 with a Lightning invoice, pays the invoice and retries with proof of payment, and each payment buys one request. There are no accounts to create and no API keys to hand out.
Yes. The TypeScript and C# clients see the 402, check the invoice's amount against the per-request limit and the budget you set, pay it and retry. Agents on MCP have the pay_l402_challenge tool.
Register a webhook with lnbot webhook create, or wait on the invoice's event stream: the API sends settled or expired over Server-Sent Events. lnbot invoice create waits for the payment for you.
ln.bot does: balances sit on the Lightning nodes we run, and we operate their channel liquidity. Each wallet is its own balance, reached with its API keys. Treat a wallet as an operational balance, a hot wallet for near-term spending, and keep what you don't need on infrastructure you control.
Restore access with the recovery passphrase you got at setup (lnbot restore recovery), or with a passkey if you registered one in the browser (lnbot restore passkey). If you lose both the key and the passphrase, the wallet can't be recovered.
A user key (uk_) works for every wallet under your account. A wallet key (wk_) is limited to one wallet, which makes it the one to give an agent that only needs that wallet.
Quick start, the CLI, the MCP server, the REST API and the SDKs: every call, with examples.
Read the docsHow Lightning, Lightning addresses and L402 work, and how AI agents use ln.bot to send and receive bitcoin.
Step by step: give an AI agent a wallet, charge per request for an API, and sell an agent's skills for bitcoin.
How ln.bot compares to other Lightning wallet services and APIs.