L402 API
Pay with Bitcoin, get AI results. Copy-paste the commands below.
Choose a service:
Before You Start
Want to try this without a terminal? Use Send Fax on the web — pay with any Lightning wallet, no setup needed.
L402 Fax Sending API
Send a fax to any fax number worldwide. 500 sats for up to 10 pages, +50 sats per additional page (max 350).Two modes: send a PDF by URL, or type text and we generate a PDF server-side.
Endpoint: https://sats4ai.com/api/l402/send-fax
Step 1 — Request invoice (PDF mode)
curl -X POST https://sats4ai.com/api/l402/send-fax \
-H "Content-Type: application/json" \
-d '{"phone_number":"+15551234567","mode":"pdf","pdf_url":"https://example.com/document.pdf","cover_text":"Please find attached my signed W-9. — Jane","pages":3}' \
-iOr text mode
curl -X POST https://sats4ai.com/api/l402/send-fax \
-H "Content-Type: application/json" \
-d '{"phone_number":"+15551234567","mode":"text","text":"Please confirm receipt of order #12345 by end of day. Thanks.","pages":1}' \
-iStep 2 — Pay the Lightning invoice
Pay the invoice returned in the www-authenticate header. Your wallet returns a preimage.
Step 3 — Replay with auth
curl -X POST https://sats4ai.com/api/l402/send-fax \
-H "Content-Type: application/json" \
-H "Authorization: L402 <MACAROON>:<PREIMAGE>" \
-d '{"phone_number":"+15551234567","mode":"text","text":"Please confirm receipt of order #12345 by end of day. Thanks.","pages":1}'Success response:
{
"status": "queued",
"fax_id": "fax_abc123",
"pages": 3,
"paid_pages": 3,
"amount_sats": 500
}Parameters
phone_number: string
Destination fax number in E.164 format (e.g. +15551234567).
mode: "pdf" | "text"
pdf — we fetch a PDF from the provided URL.text — we format your typed text into a PDF locally (no external dependencies).
pdf_url: string (mode=pdf)
Public HTTPS URL returning application/pdf. Max 50 MB, max 350 pages (Telnyx limit).
text: string (mode=text)
Message content to format as a PDF.
cover_text: string (optional, mode=pdf only)
Cover page text prepended to the PDF. Counts as +1 page.
pages: number (required)
Expected page count (1–350). Determines the invoice amount. We verify the actual page count after fetching/generating the PDF — if the PDF has more pages than you paid for, the request is rejected and your payment refunded via LNURL-withdraw. Overpayment is non-refundable, so don't wildly over-declare.
Pricing: max(500, 500 + (pages - 10) * 50). 10 pages = 500 sats. 15 pages = 750 sats. 50 pages = 2500 sats.
Limits
- Max 350 pages per fax (Telnyx hard limit)
- Max 50 MB file size
- PDF only (DOCX / other formats: v2 — use the web UI for image-to-PDF today)