JiwaAI
Blog
โ†All posts
cost-optimization
architecture
ai

Running an AI Content Engine for Under a Dollar

Jiwa AI Teamยท

The Cost Ceiling Nobody Talks About

There's a dirty secret in AI product development: the technology works, but the margins don't. When every user interaction triggers multiple calls to large language models and image generation APIs, costs scale linearly with usage. For a product targeting Southeast Asian small businesses โ€” where subscription willingness is measured in tens of dollars, not hundreds โ€” this math has to work at a fundamentally different scale.

Our target was aggressive: the total AI cost of onboarding a single business โ€” analyzing their brand, matching influencers, planning content, generating captions, creating images, and scoring quality โ€” needed to stay under one dollar.

Batching: One Call Instead of Six

The most impactful cost optimization was also the simplest. Instead of generating each post caption in a separate AI call, we batch all posts into a single request. One call generates captions for all six posts in a content calendar. One call scores quality for all posts. One call handles the entire brand analysis.

This isn't just about reducing API costs โ€” it's about reducing latency too. Six sequential AI calls take six times as long as one. And since we're sending all the brand context in every call anyway, batching eliminates the redundant transmission of the same background information.

The total intelligence cost per onboarding comes to roughly six AI calls regardless of how many posts are generated. Brand analysis, theme extraction, mood board analysis, influencer matching, calendar planning, and a combined caption generation plus quality scoring pass. At current API pricing, that's around ten cents.

Image Generation: The Expensive Part

Text intelligence is cheap. Image generation is where costs add up. Each high-quality image costs one to two cents to generate, and some content strategies require multiple generation steps per post โ€” a background scene, a face generation, a background removal, and the final composite.

We control this through two mechanisms. First, not every post type needs the full pipeline. Product-only posts with no influencer face skip the face generation step entirely. Standard scene posts without product compositing skip the background removal and compositing steps. The pipeline adapts its complexity to what each post actually requires.

Second, we cache aggressively. Product cutouts โ€” the transparent-background versions of product photos โ€” are stored by a hash of the source URL. The first time a product image is processed, it costs a couple of cents for background removal. Every subsequent use of that same product photo is free. For businesses that regenerate content or run multiple campaigns, this adds up quickly.

Storage: Almost Free at Scale

Image storage is the one cost that could theoretically grow without bound, but in practice it's negligible. We optimize every image before storage โ€” resizing to a maximum dimension, compressing to a quality level that's indistinguishable from the original on social media, and using efficient formats.

The result is roughly ten megabytes of storage per onboarding. At current cloud storage pricing, that rounds to essentially zero. Even at thousands of onboardings, storage remains a rounding error in the cost structure.

The Economics of Falling Back

Our graceful degradation strategy has a hidden economic benefit. When the premium composite image pipeline fails and we fall back to simpler generation approaches, the fallback is also cheaper. A single standard image generation call costs less than the three-step composite pipeline.

This means partial failures don't just preserve the user experience โ€” they actually cost less than full success. We don't optimize for this intentionally, but it provides a natural cost ceiling. The most expensive onboarding path is the one where every component works perfectly on the first try, and even that stays well under sixty cents.

What We Don't Spend On

Equally important to what we optimize is what we choose not to pay for. We don't use the largest, most expensive AI models. For structured analysis tasks like brand profiling and calendar generation, mid-tier models produce results that are indistinguishable from premium ones at a fraction of the cost.

We don't generate high-resolution images. Social media posts are viewed on phone screens โ€” the difference between a standard and premium resolution image is invisible to the end user but doubles the generation cost.

We don't run speculative generation. Every AI call serves a specific, needed purpose. There's no "generate three options and pick the best one" pattern โ€” we generate one result, score it, and move on. When quality scoring suggests a post is weak, the user can regenerate it on demand rather than the system burning credits on alternatives preemptively.

Why the Math Matters

The per-onboarding cost isn't just a business metric โ€” it's a product design constraint that shapes everything. At under sixty cents per business, we can offer free trials without hesitation. We can let users regenerate posts without worrying about runaway costs. We can serve the warung owner in Bandung and the boutique in Singapore at the same price point.

Most importantly, it means the unit economics work at the scale we're targeting. Southeast Asia has millions of small businesses that could benefit from AI-generated marketing content. Serving them requires costs measured in cents, not dollars. That's the ceiling we designed for, and everything in the architecture reflects it.