Turn any file into a public Swarm link — pay per-use with USDC via x402, no API keys needed.
What it does
x402 Swarm Storage is a decentralized file hosting API that lets you upload any file (HTML, JSON, images, assets) up to 100 MB and receive a public, shareable gateway URL backed by Ethereum Swarm. The service abstracts away the complexity of purchasing Swarm postage stamps on Gnosis Chain; you simply pay with USDC on Base or Solana through the x402 payment protocol.
The workflow is two steps. First, POST to `/prepare` with a desired storage duration (1 day, 7 days, or 14 days). The endpoint returns a 402 Payment Required challenge; once the USDC payment is settled, you receive an encrypted `uploadToken` valid for 10 minutes. Second, POST your files as multipart form data to `/upload` along with the token. The server handles chunking, stamping, and uploading to Swarm, then returns a public URL of the form `https://{cid}.bzz.sh/{filename}`. The upload endpoint is idempotent — safe to retry on timeout.
Pricing is straightforward: $0.01 USDC for 1 day, $0.07 for 7 days, $0.12 for 2 weeks (per the OpenAPI spec; the landing page lists slightly higher prices of $0.04, $0.25, and $0.50 respectively — the live `/pricing` endpoint confirms the lower figures). No accounts or API keys are required; payment itself serves as authentication. A free `/pricing` GET endpoint returns current tiers. The service is designed for AI agents publishing inference results, temporary dashboards, or one-off visualizations.
Capabilities
Use cases
- —Publishing AI inference results as shareable web pages
- —Hosting temporary dashboards or visualizations for a fixed duration
- —Uploading images or assets from an autonomous agent without managing credentials
- —Sharing one-off HTML reports or JSON payloads via a public link
- —Storing files on decentralized infrastructure with automatic expiry
Fit
Best for
- —AI agents that need to publish files without managing API keys
- —Temporary content hosting with automatic expiry (1–14 days)
- —Developers wanting Swarm storage without dealing with BZZ tokens or Gnosis Chain
Not for
- —Long-term or permanent file storage beyond 14 days
- —Large files exceeding 100 MB
- —Private or access-controlled content (all uploads are public)
Quick start
# 1. Prepare (triggers x402 payment)
curl -X POST 'https://x402.o8.is/prepare?duration=1d' \
--header 'PAYMENT-SIGNATURE: <x402_signature>'
# Returns: {"uploadToken": "...", "expiresAt": "..."}
# 2. Upload files
curl -X POST 'https://x402.o8.is/upload' \
-F 'uploadToken=YOUR_TOKEN' \
-F 'files=@index.html;type=text/html'Example
Request
{
"url": "https://x402.o8.is/prepare?duration=7d",
"method": "POST",
"headers": {
"PAYMENT-SIGNATURE": "<x402_v2_signature>"
}
}Response
{
"readyAt": "2025-07-15T12:00:00.000Z",
"success": true,
"duration": "7d",
"expiresAt": "2025-07-15T12:10:00.000Z",
"uploadToken": "a1b2c3d4e5f6..."
}Endpoint
Quality
Full OpenAPI 3.0 spec with three documented endpoints, live 402 challenge confirmed, and a working /pricing endpoint returning real data. Docs are thorough. Minor inconsistency between landing page prices and OpenAPI/pricing endpoint prices lowers the score slightly.
Warnings
- —Pricing inconsistency: the landing page lists $0.04 / $0.25 / $0.50 for 1d/7d/14d, but the OpenAPI spec and live /pricing endpoint return $0.01 / $0.07 / $0.12. The live endpoint is likely authoritative but verify before relying on prices.
- —The x402 challenge object returned in the probe was empty ({}), so the exact payment parameters (network, token address, amount in base units) could not be independently verified from the probe alone.
- —All uploaded content is publicly accessible — not suitable for sensitive data.
Citations
- —Pricing tiers from live endpoint: 1d=$0.01, 7d=$0.07, 14d=$0.12, max 100MBhttps://x402.o8.is/pricing
- —Landing page lists different prices: 1d=$0.04, 7d=$0.25, 14d=$0.50https://x402.o8.is
- —OpenAPI spec version 2.0.0 documents /prepare, /upload, and /pricing endpointshttps://x402.o8.is/docs
- —Upload endpoint is idempotent and retry-safe; token valid for 10 minuteshttps://x402.o8.is/docs
- —Payment accepted in USDC on Base or Solana via x402 protocolhttps://x402.o8.is
- —Files are stored on Ethereum Swarm with public gateway URLs of the form https://{cid}.bzz.sh/{filename}https://x402.o8.is/docs