A fax API for AI agents — paid per page over Tempo/MPP (USDC.e). No signup, no
API key, no dashboard. An agent calls one endpoint, gets a 402 Payment Required with an MPP Payment
challenge, pays in USDC.e on Tempo, and the fax goes out. It's "AgentMail, but for faxes."
Pay it in one line with the Tempo CLI:
tempo request -X POST --json '{"to":"+14155550123","file_url":"https://example.com/doc.pdf"}' \ https://agentfax.val.run/v1/fax
- Permissionless monetization. No marketplace to apply to. You stand up an HTTP endpoint that
returns a 402
WWW-Authenticate: Paymentchallenge pointing at your wallet; any MPP client pays it. - No facilitator, no keys to babysit.
mppxverifies and settles the payment directly against the Tempo chain — there's no payment processor in the middle. - Per-page pricing. On the unpaid request we count the PDF's pages and price the charge as pages × rate, so the 402 tells the agent the exact cost up front.
- Documents are never stored. The file is forwarded to the fax network and dropped — it never touches our database. We keep only a minimal send-metadata log (destination, pages, amount, payer).
- Pluggable fax backend. Real faxing via the Sinch Fax API v3 when keys are set; otherwise a sandbox that simulates sending, so the whole pay→fax loop works with no fax account.
| Method | Path | Paid | Description |
|---|---|---|---|
POST | /v1/fax | ✅ MPP | Send a fax. Returns 402 (MPP Payment challenge) until paid, then a job id. |
GET | /v1/fax/{id} | free | Live delivery status (proxied from the carrier). |
GET | /v1/info | free | Machine-readable manifest (price, network, recipient, schema, example). |
GET | /openapi.json | free | MPP discovery document (for registries like MPPScan). |
GET | /llms.txt | free | Pointer file so an agent can self-onboard. |
GET | /og.png | free | Social card image. |
to is required (E.164). Provide the document as either file_url (a public PDF URL) or
content_base64 (+ optional file_name). metadata is optional and echoed back.
Unpaid, POST /v1/fax returns 402 with a WWW-Authenticate: Payment header. The Tempo CLI (or any
MPP client) reads it, signs the USDC.e payment, and retries automatically.
- Rail: MPP (the open
PaymentHTTP-auth scheme) on Tempo mainnet (chain id 4217). - Asset: USDC.e —
0x20C000000000000000000000b9537d11c60E8b50(6 decimals). - Price: per page (
FAX_PRICE_PER_PAGE, default$0.20). - Settlement: verified directly against the Tempo RPC by
mppx— no facilitator. - You get paid at
TEMPO_RECIPIENT(your Tempo wallet). - x402 (Coinbase / Circle) is parked in the codebase (
payment.ts); re-enable it with a valid CDP facilitator key to also accept Base USDC agents.
The document itself is never stored. We keep a minimal SQLite metadata log (db.ts) — destination,
page count, amount, paying wallet, status, timestamp — for a running total. No document content, ever.
Sensible defaults; for production set your Sinch keys and Tempo recipient.
| Env var | Default | Purpose |
|---|---|---|
TEMPO_RECIPIENT | a demo wallet | Tempo address that receives the USDC.e. |
MPP_SECRET_KEY | (set) | Server HMAC secret binding challenges to credentials. |
MPP_SIGNER_KEY | (set) | Server signer mppx requires (session settlement; unused by one-shot charge). |
FAX_PRICE_PER_PAGE | 0.20 | Price per page, in USD. |
SINCH_KEY_ID / SINCH_KEY_SECRET | unset → sandbox | Sinch Fax access key (OAuth2) for real faxing. |
SINCH_PROJECT_ID | unset → sandbox | Sinch project the Fax API is scoped to. |
SINCH_FROM | unset | Optional sender fax number. |
-
Fund your Tempo wallet with a little USDC.e (
tempo wallet fund). -
Add your Sinch Fax credentials (from dashboard.sinch.com — Access Keys + Project ID):
👉 Add SINCH_KEY_ID here: https://www.val.town/x/stevekrouse/agentfax/environment-variables?key=SINCH_KEY_ID
👉 Add SINCH_KEY_SECRET here: https://www.val.town/x/stevekrouse/agentfax/environment-variables?key=SINCH_KEY_SECRET
👉 Add SINCH_PROJECT_ID here: https://www.val.town/x/stevekrouse/agentfax/environment-variables?key=SINCH_PROJECT_ID
main.ts— Hono server: routes, MPP payment gate, SSR landing page, metadata logging.mpp.ts— Tempo/MPP rail viamppx(mainnet, USDC.e), per-page pricing,paymentInfo().fax.ts— fax backend (Sinch Fax v3 + sandbox), job-id codec, live status.db.ts— minimal metadata log (never the document content).og.ts— Open Graph / Twitter card image.payment.ts— parked x402 rail (re-enable with a CDP key).frontend/— SSR React + Twind landing page.