Skip to main content

L402 API Access

Use AI tools by paying with Bitcoin. No signup. No API keys.

Pay with Bitcoin. Get AI Results.

Access 22+ AI services using Lightning Network micropayments. No signup, no monthly subscription, no data collection. Just Sats.

Not a developer? You can use all of these tools directly on the web — browse available tools and pay with any Lightning wallet, no setup needed.

No Signup

No accounts, no emails, no passwords

💰

Pay Per Use

No subscriptions. Only pay when you use it

🔒

Private

No personal data collected. Ever

Bitcoin Native

Lightning payments settle in seconds

How It Works

1

Send Your Request

Call any API endpoint with your data. You'll get back a Lightning invoice to pay.

2

Pay with Lightning

Pay the invoice with any Lightning wallet. Takes seconds, costs pennies.

3

Get Your Result

Re-send the same request with your proof of payment. Done.

Services & Pricing

All prices in Satoshis (1 Sat ~ $0.001 USD). Click any service for full instructions.

ServicePrice
Image Generation100-200 Sats/image
Text Generation5-15 Sats minimum
Video Generation300-550 Sats/sec
Video from Image100 Sats/sec
Music Generation100 Sats/song
Text to Speech300 Sats
Speech Transcription10 Sats/minute
Image Analysis21 Sats/image
3D Model Generation350 Sats/model
File Conversion100 Sats/file
OCR / Text Extraction10 Sats/page
SMS Servicevaries by country
Automated Phone Callvaries by country & duration
AI Phone Call~150-250 Sats/call
Email Sending200 Sats/email
Voice Cloning7,500 Sats
Image Editing200-450 Sats/edit
PDF Merge100 Sats
HTML to PDF50 Sats
Document TranslationFrom 4 Sats
Receipt OCR50 Sats/page

Easiest Way: Use lnget

lnget is Lightning Labs' official CLI for L402 APIs — handles request, payment, and authentication in a single command. Install: go install github.com/lightninglabs/lnget/cmd/lnget@latest

Copy and paste any of these examples:

Generate an image:

lnget -X POST https://sats4ai.com/api/l402/generate-image \
  -d '{"prompt":"A cat on the moon"}'

Generate text:

lnget -X POST https://sats4ai.com/api/l402/generate-text \
  -d '{"input":[{"role":"user","content":"Explain Bitcoin"}]}'

Transcribe audio:

lnget -X POST https://sats4ai.com/api/l402/transcribe-audio \
  -d '{"file":"<base64-audio>","type":"transcription"}'

lnget auto-pays the Lightning invoice, caches the token, and returns the result. Subsequent calls to the same endpoint reuse the cached token.

L402 tokens expire after 10 minutes — pay the invoice and submit your request within that window. Media URLs (images, video, audio) expire after 2 hours. Download or display them promptly.

Building autonomous agents? CLW is a Bitcoin wallet built for AI agents — lets them receive, hold, and spend sats programmatically.

Auto-Paying L402 Libraries

These open-source libraries handle L402 payment automatically — your code makes a normal HTTP request, the library detects the 402 challenge, pays the invoice, and retries with proof. No payment logic needed.

TS
npm install l402-requests

l402-requests — three lines of TypeScript. Supports Strike, LND, NWC (Alby Hub, CoinOS), with built-in budget controls and spending logs.

PY
pip install l402-requests

l402-requests — same auto-paying flow for Python.

.NET
dotnet add package l402-dotnet

l402-dotnet — same auto-paying flow for .NET.

import { get } from 'l402-requests';

// That's it. The library pays the Lightning invoice automatically.
const response = await get("https://sats4ai.com/api/l402/generate-text", {
  method: "POST",
  body: JSON.stringify({ input: [{ role: "user", content: "Explain Bitcoin" }] })
});

Manual Flow (Step by Step)

If you prefer to handle payments yourself (or want to understand how L402 works under the hood):

1

Send your request to the API endpoint

You'll get a 402 Payment Required response with a Lightning invoice and a macaroon (access token).

2

Pay the Lightning invoice

Use any Lightning wallet (Phoenix, Muun, Wallet of Satoshi, Alby, etc.). For autonomous AI agents, see CLW. Save the preimage (proof of payment) your wallet gives you.

3

Re-send the exact same request with your payment proof

Add this header: Authorization: L402 <macaroon>:<preimage>

Click any service below for the exact copy-paste commands.

What is L402?

L402 is a standard that lets you pay for API access with Bitcoin instead of signing up for accounts and handing over personal data. It combines:

  • Lightning Network — instant Bitcoin payments (fractions of a penny)
  • Macaroons — tamper-proof access tokens (like a receipt)

The result: pay-per-use AI with full privacy. No accounts, no API keys, no credit cards, no monthly bills. You only pay for what you use, and we never know who you are.

Learn more about the L402 protocol

For Developers: All endpoints and pricing are available as machine-readable JSON at /.well-known/l402-services, /api/l402/models, and /api/models/routing. View L402 code examples (Python, Node.js, curl) or the MCP server repo on GitHub. Found a bug? Report it on GitHub or join the discussions.

Get Started

Pick a service to see full instructions with copy-paste examples.

Image Generation

Create images from text prompts

100-200 Sats/imageView docs →

Text Generation

AI chat and text completion

5-15 Sats minimumView docs →

Video Generation

Generate videos from text

300-550 Sats/secView docs →

Video from Image

Animate images into video

100 Sats/secView docs →

Music Generation

Create songs with AI vocals

100 Sats/songView docs →

Text to Speech

Convert text to natural speech audio

300 SatsView docs →

Speech Transcription

Transcribe audio to text

10 Sats/minuteView docs →

Image Analysis

Ask AI about any image

21 Sats/imageView docs →

3D Model Generation

Turn photos into 3D models

350 Sats/modelView docs →

File Conversion

Convert between file formats

100 Sats/fileView docs →

OCR / Text Extraction

Extract text from PDFs and images

10 Sats/pageView docs →

SMS Service

Send text messages globally

varies by countryView docs →

Automated Phone Call

Place calls with TTS or audio playback. Pricing scales with duration and destination.

varies by country & durationView docs →

AI Phone Call

Send an AI voice agent to make a two-way phone call with transcript and analysis

~150-250 Sats/callView docs →

Email Sending

Send a one-off email to any address — no account, no domain setup, no monthly fee

200 Sats/emailView docs →

Voice Cloning

Clone a voice from an audio sample for use with TTS

7,500 SatsView docs →

Image Editing

Edit images with AI — background removal, style transfer, object removal

200-450 Sats/editView docs →

PDF Merge

Merge multiple PDFs into a single document

100 SatsView docs →

HTML to PDF

Convert HTML or Markdown to PDF documents

50 SatsView docs →

Document Translation

Translate text across 119 languages with ultra-fast AI

From 4 SatsView docs →

Receipt OCR

Extract structured data from receipts and invoices

50 Sats/pageView docs →