We Launched a $0.04/Image AI Generator Powered by Cloudflare Workers AI
The pitch is simple: you give us a prompt, we give you a 1024x1024 image rendered on Cloudflare's GPU edge, and you pay between $0.04 and $0.13 per image depending on which tier you buy. No account. No API key dance. No "credits expire in 30 days" nonsense.
It's live at toughlovesec.win/imagegen and it's the first piece of what we're calling the TLS Public APIs — small, single-purpose endpoints designed for AI agents and developers who want to spend $1 to test something instead of $20 to onboard.
Why we built this
Most image generation APIs are priced for production volume. OpenAI charges $0.04 per standard DALL-E 3 image — which is fine if you're already on their stack, but you're locked into a $5 minimum credit purchase, account verification, and a billing model that punishes you if you stop using it.
Stability and Replicate are similar. Cheap per-image, but the friction to start is enormous when all you wanted to do was generate one logo for a side project.
Cloudflare Workers AI changed the math. The Stable Diffusion XL Lightning and Flux-1-Schnell models run directly on Cloudflare's GPU fleet at a marginal cost most people don't realize. We wrap that with a Worker, bolt on Stripe checkout for the bulk tiers and an HTTP 402 challenge for agent-style micropayments, and you get a one-shot image API that costs less than the free TLS scan would cost on infrastructure.
The three tiers
We didn't want to do credits. Credits suck. Here's what we shipped:
- $0.50 — single image. One prompt, one PNG, delivered in roughly 4 seconds. Stripe Checkout handles the payment, the redirect drops you on a page with the rendered image and a download button.
- $1.99 — 12-image pack. Twelve generations on a single token. Use them for variations, A/B testing thumbnails, batch concept art. The pack token is yours forever — no expiration.
- $7.99 — 100-image bundle. Eight cents per image at this tier. This is the rate that beats every other public API we've benchmarked when you account for setup time.
Sample output, sample call
For the agent crowd, the endpoint also speaks x402. You hit it without payment, get back a 402 with a payment challenge, your wallet signs, you retry, you get the image:
curl https://toughlovesec.win/api/imagegen \
-X POST \
-H "Content-Type: application/json" \
-d '{"prompt":"a cyberpunk owl coding on a phone, neon, photoreal","model":"flux-1-schnell"}'
First response: HTTP 402 Payment Required with the x402 header. Pay the $0.04, retry, get back a JSON body with a base64 PNG and a CDN URL. Total round trip including payment: under 6 seconds on a warm wallet.
Who's actually buying these
Three early use cases we're seeing in the first week:
- Solo founders generating launch assets. Twelve images for $1.99 covers a landing-page hero, three Open Graph cards, and a few social variants. Cheaper than buying a Canva subscription you'd cancel anyway.
- AI agents generating thumbnails on demand. The x402 endpoint means an autonomous agent can run a YouTube channel and generate thumbnails per video without anyone hand-holding API keys.
- Devs prototyping image features. If you're building a feature that needs Stable Diffusion in the loop and you want to know if it works before committing to a Stability or Replicate account, $0.50 is your test budget.
What's under the hood
The whole thing is one Cloudflare Worker. No Lambda, no Docker, no GPU bill. The worker:
- Verifies the Stripe session or x402 payment
- Forwards the prompt to
@cf/black-forest-labs/flux-1-schnellor@cf/stabilityai/stable-diffusion-xl-base-1.0 - Streams the result back to the client
- Logs the generation hash in KV so we can re-serve if the user refreshes
Cold start: ~100ms. Generation: 3-5 seconds for SDXL Lightning, 2-3 for Flux Schnell. Total user-perceived latency from "click pay" to "image rendered" is under 8 seconds on the $0.50 tier.
The honest tradeoffs
This isn't going to replace Midjourney for serious creative work. The model is what Cloudflare runs — we don't fine-tune, we don't offer ControlNet, we don't expose seeds (yet). It's deliberately simple. If you need granular controls, you're better off with Replicate or a hosted ComfyUI.
What it does beat: every "sign up, verify email, add a credit card, buy minimum $5 in credits" workflow. If you want one image, fast, with no account, this is the lowest-friction option we know of.
Coming soon
We're adding video generation (likely via Workers AI's Stable Video Diffusion when it leaves beta) and a "remix this image" endpoint that takes an existing URL and a modification prompt. The pricing model stays the same: pay-per-call, no accounts, x402 + Stripe.
If you're an agent developer working on the x402 ecosystem, this is one of a handful of production endpoints currently live and accepting micropayments. The other two TLS revenue endpoints — ClawWork AI labor and contract risk scoring — work the same way.
Questions, feedback, weird prompts you want to test: talk to LIA. She handles intake.