AI Artwork SaaS

Prepaid credits that track real model costs

Generate, edit and export production-ready artwork, paid for with prepaid credits.

Working build Studio product · 2026 · Web

GALLERY1024 × 1024CREDITSTop up1,240Top-up · card+500Generate · 1024px−4Edit · inpaint−2PROMPTCozy berry farm at dawn,soft paper texture

The problem

Image models charge per call, and the cost changes with the model and the image size. A flat monthly plan either loses money on heavy users or overcharges light ones. The product needed billing that follows real usage and never charges anyone twice.

What we built

  • An Astro app on Cloudflare Workers with an interactive React editor to generate, adjust, edit, filter and export images.
  • Generation and editing jobs routed to OpenAI and Gemini image models.
  • Prepaid credit packs sold through a hosted checkout, with a wallet and ledger in Cloudflare D1 that records every top-up and every spend.
  • Idempotent payment webhooks: a retried event can never credit an account twice.
  • Generated files stored in R2 behind signed download links, rate limiting in KV, and sign-in with Clerk.

Decisions that mattered

01

Credits instead of a subscription

Customers pay for what they generate, so the price tracks the real model cost and nobody subsidises anybody else.

02

A ledger, not a balance field

Every change to a balance is its own row. Support questions, refunds and reconciliation with the payment provider become a query, not an investigation.

Have an AI idea, or an AI feature that isn’t working?

Tell us what you are trying to do. You will get a straight answer within one business day, including when AI is not the right tool.

Book a 30-minute call hello@kby-studio.com

The intro call is free and comes with no obligation.