What is Preimage Research?
Preimage Research is payment infrastructure for machine-to-machine commerce. It enables APIs to accept USDC micropayments using the x402 protocol (HTTP 402 + blockchain payments).
The Problem
Traditional API monetization requires:
- Complex authentication systems
- Subscription management
- Payment processing (credit cards, invoices)
- Usage tracking and billing
- Customer account management
This creates significant overhead for API providers and friction for API consumers.
The Solution
With Preimage Research:
- API Providers add one line of middleware
- API Consumers use a simple client library
- Payments happen automatically via USDC on Base/Ethereum/Polygon
- No subscriptions, no accounts - just pay-per-use
Pay-per-call pricing: Charge $0.001 per API call, $0.01 per LLM token, or $0.05 per compute second. Payments as granular as 1/1,000,000th of a USDC (6 decimals).
Key Features
x402 Protocol
Preimage Research implements the x402 protocol, a standard for HTTP payments developed by Coinbase:
- 402 Payment Required HTTP status code
- Challenge-response pattern for authentication
- EIP-3009 USDC transfers with authorization
- Macaroons for time-limited access tokens
- JWS receipts for verifiable proof of payment
Non-Custodial
You control your wallet. Payments go directly to your address. Preimage Research never holds funds.
┌──────────────┐ ┌──────────────┐
│ Buyer │ ──USDC─→│ Provider │ (98%)
│ Wallet │ │ Wallet │
└──────────────┘ ↓ └──────────────┘
│
└───→ Preimage Research (2%)Dual Invoice Architecture
Every payment is split automatically:
- 98% to the API provider
- 2% to Preimage Research platform
Both payments happen atomically in a single blockchain transaction.
Verifiable Receipts
Every API call that involves payment generates a cryptographically signed receipt:
{
"paymentId": "pay_abc123",
"providerId": "prov_xyz789",
"endpointId": "ep_weather",
"totalUsdc": "1000",
"providerUsdc": "980",
"platformUsdc": "20",
"timestamp": "2024-01-15T10:30:00Z",
"signature": "eyJhbGciOiJFUzI1NiJ9..."
}These receipts are:
- Signed with JWS (JSON Web Signature)
- Verifiable by anyone with the public key
- Immutable proof of payment
- Finance-ready for accounting and compliance
Receipts are returned in the Preimage-Receipt HTTP header on successful requests. Store them for auditing and reconciliation.
Supported Languages
Preimage Research provides 6 production-ready SDKs:
Client SDK (Buyer Side)
- TypeScript -
@preimage/client
Provider SDKs (Seller Side)
- Express (Node.js) -
@preimage/express - FastAPI (Python) -
preimage-fastapi - Django (Python) -
preimage-django - Gin (Go) -
github.com/preimage-labs/preimage-go-gin - Axum (Rust) -
preimage-axum
All SDKs implement the same x402 protocol and work seamlessly together.
Use Cases
AI API Monetization
Charge per token for LLM inference:
pricing: {
usdcPerUnit: 0.00001, // $0.00001 per token
unitKind: 'token'
}Data APIs
Charge per request:
pricing: {
usdcPerUnit: 0.001, // $0.001 per request
unitKind: 'operation'
}Compute APIs
Charge per second of compute:
pricing: {
usdcPerUnit: 0.05, // $0.05 per second
unitKind: 'second'
}Content APIs
Charge per article, video, or file:
pricing: {
usdcPerUnit: 0.10, // $0.10 per article
unitKind: 'operation'
}How Much Does It Cost?
For API Providers
Preimage uses 4-tier dynamic pricing that's 50-95% cheaper than traditional processors:
| Payment Amount | Preimage Fee | Stripe Fee | You Save |
|---|---|---|---|
| $0.10 (micro) | $0.005 (5%) | Can't process | Only option! |
| $1.00 | $0.08 (8%) | $0.329 (33%) | 76% cheaper |
| $5.00 | $0.20 (4%) | $0.445 (9%) | 55% cheaper |
| $50.00 | $1.30 (2.6%) | $1.745 (3.5%) | 26% cheaper |
Tier Breakdown:
- 🔹 Ultra-Micro ($0.005-$0.009): 10% only
- 🔹 Micropayments ($0.01-$0.99): 5% only
- 🔹 Standard ($1-$9.99): 3% + $0.05
- 🔹 Large ($10+): 2.5% + $0.05
Additional Benefits:
- ✅ No monthly fees
- ✅ No setup costs
- ✅ No minimum volume
- ✅ No gas fees (Preimage covers settlement)
- ✅ Fast settlement (1-2 hours vs 2-7 days)
For API Consumers
- ✅ Pay only for what you use
- ✅ No subscriptions
- ✅ No accounts to manage
- ✅ TRUE micropayments - payments as low as $0.005 (half a cent!)
- ✅ 50-95% savings vs traditional processors
- ⚠️ Gas fees (typically $0.01-0.10 per transaction on Base L2)
Why Percentage-Only for Micropayments?
Flat fees kill small payments:
- Stripe charges $0.30 + 2.9% = 63% fee on a $0.50 payment 😱
- Preimage charges 5% = $0.025 on a $0.50 payment ✅
Preimage is the ONLY way to accept sub-dollar payments profitably!
Supported Networks
Preimage Research works on multiple EVM networks:
| Network | Type | USDC Available |
|---|---|---|
| Base | Mainnet | ✅ |
| Base Sepolia | Testnet | ✅ |
| Ethereum | Mainnet | ✅ |
| Ethereum Sepolia | Testnet | ✅ |
| Polygon | Mainnet | ✅ |
| Polygon Amoy | Testnet | ✅ |
We recommend Base for production. It has low gas fees (~$0.01), fast finality (~2s), and native USDC support.