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
Send Your Request
Call any API endpoint with your data. You'll get back a Lightning invoice to pay.
Pay with Lightning
Pay the invoice with any Lightning wallet. Takes seconds, costs pennies.
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.
| Service | Price |
|---|---|
| Image Generation | 100-200 Sats/image |
| Text Generation | 5-15 Sats minimum |
| Video Generation | 300-550 Sats/sec |
| Video from Image | 100 Sats/sec |
| Music Generation | 100 Sats/song |
| Text to Speech | 300 Sats |
| Speech Transcription | 10 Sats/minute |
| Image Analysis | 21 Sats/image |
| 3D Model Generation | 350 Sats/model |
| File Conversion | 100 Sats/file |
| OCR / Text Extraction | 10 Sats/page |
| SMS Service | varies by country |
| Automated Phone Call | varies by country & duration |
| AI Phone Call | ~150-250 Sats/call |
| Email Sending | 200 Sats/email |
| Voice Cloning | 7,500 Sats |
| Image Editing | 200-450 Sats/edit |
| PDF Merge | 100 Sats |
| HTML to PDF | 50 Sats |
| Document Translation | From 4 Sats |
| Receipt OCR | 50 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.
npm install l402-requestsl402-requests — three lines of TypeScript. Supports Strike, LND, NWC (Alby Hub, CoinOS), with built-in budget controls and spending logs.
pip install l402-requestsl402-requests — same auto-paying flow for Python.
dotnet add package l402-dotnetl402-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):
Send your request to the API endpoint
You'll get a 402 Payment Required response with a Lightning invoice and a macaroon (access token).
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.
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.
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
Text Generation
AI chat and text completion
Video Generation
Generate videos from text
Video from Image
Animate images into video
Music Generation
Create songs with AI vocals
Text to Speech
Convert text to natural speech audio
Speech Transcription
Transcribe audio to text
Image Analysis
Ask AI about any image
3D Model Generation
Turn photos into 3D models
File Conversion
Convert between file formats
OCR / Text Extraction
Extract text from PDFs and images
SMS Service
Send text messages globally
Automated Phone Call
Place calls with TTS or audio playback. Pricing scales with duration and destination.
AI Phone Call
Send an AI voice agent to make a two-way phone call with transcript and analysis
Email Sending
Send a one-off email to any address — no account, no domain setup, no monthly fee
Voice Cloning
Clone a voice from an audio sample for use with TTS
Image Editing
Edit images with AI — background removal, style transfer, object removal
PDF Merge
Merge multiple PDFs into a single document
HTML to PDF
Convert HTML or Markdown to PDF documents
Document Translation
Translate text across 119 languages with ultra-fast AI
Receipt OCR
Extract structured data from receipts and invoices