Skip to main content
PressMCP & Agents

Featured in Blockspace: How to Make Your First AI Agentic Payment with Bitcoin

Blockspace just published a step-by-step tutorial showing readers how to give an AI agent a Bitcoin wallet and have it pay for a real phone call — in three commands. The entire flow uses Sats4AI's L402 API, and every reader who follows along pays sats to place a call. Here's what happened, why it matters, and what you can build on top of it.

3 commandsZero accountsL402 protocolLightning paymentsReal phone call

What Blockspace Demonstrated

The Blockspace tutorial walks through the simplest possible version of an AI agentic payment: give Claude Code a Lightning wallet, point it at a paid API, and watch it handle the rest. The demo has the AI agent call someone's phone and deliver a message — paid for entirely in Bitcoin, with no account or API key on the service side.

The whole thing takes three steps and works in under a minute.

The Three-Step Flow

1

Add the Lightning Wallet MCP server

claude mcp add lightning-wallet -- npx lightning-wallet-mcp

One terminal command. This gives your AI agent the ability to create invoices, pay invoices, and manage a Bitcoin Lightning wallet.

2

Register a wallet and get free sats

"Register a new Lightning Wallet operator account"

The Lightning Wallet MCP server funds new accounts with 100 free sats. That's enough for a phone call.

3

Tell the agent to call someone

"Use the Lightning wallet to call this L402 API: POST to https://sats4ai.com/api/l402/place-call with body: {phone_number, message}"

The agent discovers the price, pays the Lightning invoice from its wallet, and places the call. No human touches the payment.

What Happens Under the Hood

The tutorial breaks down the five-step exchange that occurs in milliseconds between the AI agent and the server. This is the L402 protocol in action:

Request

The agent sends a POST request to the API with the phone number and message.

402 Response

The server returns HTTP 402 Payment Required with a Lightning invoice and a macaroon.

Payment

The agent's wallet pays the Lightning invoice automatically. Settlement is instant.

Authenticated retry

The agent re-sends the original request with the payment receipt (macaroon + preimage) in the Authorization header.

Execution

The server verifies the receipt and places the phone call. The agent gets a confirmation.

No account was created. No API key was exchanged. No credit card was entered. The agent discovered the price, paid it, and received the service — all in a single round trip. This is what internet-native money makes possible.

Why This Matters

As Blockspace puts it: the way we've historically paid for things on the internet was designed for humans. Create an account, enter a credit card, get an API key. AI agents don't have credit cards or email addresses, but they still need a way to discover services and pay for them.

The L402 protocol solves this. An agent finds a paid API, pays a Lightning invoice in milliseconds, and gets access in a single round trip. No one had to pre-register anything on the agent's behalf. If the agent has sats, it can go use paid services.

This is the shift from "humans setting up accounts for tools" to "agents paying for what they need, when they need it." The 402 status code that sat dormant for 30 years finally has a job.

The 402 Protocol Landscape

Blockspace highlights three protocols that all follow the same request-pay-retry pattern but differ in how the money moves:

L402

Bitcoin Lightning

Bitcoin over Lightning. The most decentralized option. No intermediary required. This is what Sats4AI uses.

x402

Stablecoins

USDC stablecoins on Base. Growing fast due to Coinbase's distribution, but requires a facilitator.

MPP

Fiat

Fiat rails via Stripe's Tempo. Closest to traditional payments, wrapped in the 402 pattern.

Sats4AI supports both L402 and MPP. All 25+ services are accessible through either protocol.

Beyond Phone Calls: What Your Agent Can Pay For

The Blockspace tutorial uses a phone call because it's dramatic — your AI agent called your mom. But the same three-step flow works for every service on the platform. Once your agent has a Lightning wallet, it can pay for any of these:

Image generation

from 100 sats

Text-to-image with multiple models

Video generation

from 100 sats/sec

Text or image to video

Text generation

from 1 sat

Chat with frontier AI models

Text-to-speech

300 sats

Natural voices, voice cloning

Audio transcription

10 sats/min

Speech-to-text with timestamps

Music generation

300 sats

Full songs with BPM/key control

Image analysis

21 sats

Describe, extract text, answer questions

Document OCR

10 sats/page

Scanned PDFs to structured text

File conversion

100 sats

200+ formats, up to 1 GB

SMS

from 5 sats

Text messages to 200+ countries

Email

200 sats

Send to any address

Translation

from 4 sats

119 languages, three model tiers

Every service is available via MCP (for agents like Claude Code) and L402 (for any HTTP client with a Lightning wallet).

Try It Yourself

The Blockspace tutorial is the fastest way to make your first AI agentic payment. But if you want to go deeper, here are your options:

Connect via MCP

Add Sats4AI as an MCP server and your agent gets access to 25+ tools. It can discover capabilities, check prices, and pay — all through natural language.

claude mcp add sats4ai -- npx -y sats4ai-mcp-server

Use L402 directly

Any HTTP client with a Lightning wallet can call Sats4AI's L402 endpoints. Send a request, get a 402 with an invoice, pay it, retry with the receipt. Works from any language, any framework, any agent.

Use the web dashboard

Not building an agent? Every service is also available through the browser at sats4ai.com. Pay with any Lightning wallet — scan a QR code or connect with WebLN.

The Bigger Picture

What Blockspace documented isn't just a demo. It's the first iteration of a new interaction pattern: agents discovering services, negotiating prices, and paying autonomously. No human pre-registered anything. No API key was provisioned. The agent found a service, the service quoted a price, and the agent paid.

Today it's a phone call. Tomorrow it's an agent that generates an image, transcribes a meeting, translates the notes into three languages, and emails the summary — paying for each step as it goes, from its own wallet, in sats.

The machine-payable web isn't a concept anymore. People are using it.

Give Your AI Agent a Bitcoin Wallet

25+ AI services. Pay per request with Lightning. No signup, no API keys. Three commands to get started.