cd /news/artificial-intelligence/title-show-hn-i-turned-my-homelab-gp… Β· home β€Ί topics β€Ί artificial-intelligence β€Ί article
[ARTICLE Β· art-115540] src=github.com β†— pub= topic=artificial-intelligence verified=true sentiment=Β· neutral

Title: Show HN: I turned my homelab GPU into a paid API on Base mainnet

A developer has launched a self-hosted API on Base mainnet that sells LLM inference for USDC via the x402 HTTP 402 payment protocol, with a live endpoint running on a single RTX 5090 GPU and pricing starting at $0.01 per call. The reference implementation, released under an MIT license, includes a facilitator, FastAPI paywall middleware, and an MCP server, and has already processed its first external settlement of 0.12 USDC.

read2 min views10 publishedAug 30, 2026
Title: Show HN: I turned my homelab GPU into a paid API on Base mainnet
Image: Michielbdejong (auto-discovered)

A self-hosted x402 paywall + facilitator for selling LLM inference over HTTP β€” running live on Base mainnet, paid in USDC, on a homelab GPU.

This repo is the reference implementation behind a live endpoint. Any human or AI agent with a crypto wallet can buy a completion in one HTTP round-trip: no accounts, no API keys, no signup. Payment verifies on-chain before the model runs; settlement happens after β€” a failed request is never charged.

$0.01  POST /premium/llm    27B open-weights model, 4K token cap
$0.05  POST /premium/deep   8K tokens β€” double the thinking budget on the same 27B
$0.10  POST /premium/vl     30B vision model, image understanding
free   GET  /premium/balance  live on-chain earnings (transparency endpoint)
free   POST /premium/trial    3 calls per wallet, sybil-limited by EIP-191 signature

x402 (HTTP 402 "Payment Required", revived by Coinbase) lets software pay software. This repo is the smallest serious stack we found that does it self-hosted end to end:

x402_facilitator.py

β€” your own facilitator (verify + settle). No hosted service, no middleman cut, no regional blocks.x402_paywall.py

β€” FastAPI middleware: 402 with payment requirements β†’ buyer signs β†’ facilitator verifies β†’ handler runs β†’ settlement receipt in the response body (X-PAYMENT-RESPONSE

).x402_mcp_server.py

β€” MCP wrapper so Claude/desktop agents can purchase natively.scripts/x402_client_demo.py

β€” a working buyer in ~90 lines.

buyer agent ──POST /premium/llm──▢ Caddy (path allowlist) ──▢ FastAPI paywall
                                   β–²                            β”‚
                                   β”‚ 402 + payment requirements β”‚ verify via
                                   β”‚                            β–Ό facilitator
                              wallet signs ──────────────▢ on-chain (Base)
                                                                β”‚
                                            handler runs AFTER verify
                                            settles AFTER success (β‰₯400 cancels)

Security posture (the interesting part for homelab operators):

  • The public internet reaches only the paywall routes. A reverse-proxy path allowlist 404s everything else β€” the rest of the machine (fleet control, admin API, this repo's private origin) is unreachable by design. - Wallet keys are age-encrypted at rest, decrypted in memory only.
  • Prompts are not logged or retained. The response dies with the connection.
  • Token caps per tier bound worst-case compute cost per call; every call is prepaid, so abuse is self-funding (it pays us).
pip install fastapi uvicorn x402 c web3
age-encrypt your wallet json β†’ vault/x402_receive_wallet.age
uvicorn app:app --port 8900   # app wires the middleware onto your routes

Point a buyer at it:

python3 scripts/x402_client_demo.py "$URL/premium/llm" "Write a haiku about payments"
  • Live on Base mainnet (chain 8453), USDC settlement.
  • First real external settlement: 0.12 USDC and counting β€” see the balance endpoint on the live deployment.
  • Hardware: one RTX 5090 running an AWQ-quantized 27B. ~70% gross margin per $0.01 call after electricity.

This is homelab infra, not an SLA product: best-effort uptime, one GPU, no data-retention paperwork β€” because there is no data retention. Positioning is exactly that: best-effort, cheap, keyless, and honest.

License: MIT.

── more in #artificial-intelligence 4 stories Β· sorted by recency
── more on @base 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/title-show-hn-i-turn…] indexed:0 read:2min 2026-08-30 Β· β€”