FEATURED RELEASE

Adding AI Image Generation to a Next.js App With the hiapi API

Image generation takes 60–120 seconds — too long for a single client request, so the app must split the work across a route handler that creates a task and a polling endpoint that surfaces progress without holding a serverless invocation. Calling hiapi directly from a React component leaks the API key to the browser. A Next.js route handler keeps the key on the server and gives you one auditable place to rate-limit and validate prompts. Output URLs returned by hiapi are signed and short-lived. Apps that store them directly will serve 404s on refresh — mirror every successful result to R2 (or S3 / Supabase Storage) before persisting. Cumulative Layout Shift on AI-image apps is fixed by reserving the result container's aspect ratio with CSS and matching it to the ratio sent to hiapi.

Read Article

hiapi

Tutorial · Jun 16, 2026 · 11

Adding AI Image Generation to a Next.js App With the hiapi API
Consistent Characters with Nano-Banana on hiapi: A Working Workflow for Storyboards and E-Commerce
Tutorial
Jun 16, 202612

Consistent Characters with Nano-Banana on hiapi: A Working Workflow for Storyboards and E-Commerce

Three Nano-Banana models on hiapi all tagged for character consistency: Nano-Banana ($0.05 flat), Nano-Banana-2 ($0.085 / $0.076 / $0.114 across 1K/2K/4K — 2K is cheaper than 1K), and Nano-Banana-Pro ($0.17 at 1K/2K, $0.30 at 4K). The technique is a character bible — a dense, repeatable, deterministic prompt prefix that anchors face geometry, skin/hair markers, wardrobe, and vibe across all renders. No reference image, no fine-tune, no LoRA. Storyboard demo: one engineer character ('Mira') across cover, model sheet, warm-tungsten workshop, and cold-overcast rooftop. Same beanie, same toolbelt, same beauty mark stays on the right cheek through both scenes. E-commerce demo: one fashion model ('Aria') in three full-body look-book shots — frontal hero, three-quarter angle, then a wardrobe swap to a camel double-breasted overcoat. Face, hair parting, beauty mark, and gold studs all hold across renders. Flat Nano-Banana rejects the resolution field with a 400 — only set it for Pro and -2. Output URLs have an expireAt; download bytes immediately rather than hot-linking. Total cost for all 8 images in the article: $0.52 (7 × $0.05 Nano-Banana + 1 × $0.17 Nano-Banana-Pro hero).

Read more
hiapi Image and Video Generation APIs: The Complete Platform Guide
Guide
Jun 15, 202610

hiapi Image and Video Generation APIs: The Complete Platform Guide

hiapi is an image and video generation API gateway: one Bearer-auth endpoint fronts FLUX 1.1 Pro, Nano-Banana, GPT-Image-2, Qwen-Image, Wan2.7, Seedance, and HappyHorse. Pricing is flat per task — $0.02 for gpt-image-2-beta, $0.05 for Nano-Banana or flux-1.1-pro, up to $0.823 for a 1080p Seedance clip. No token billing, no surge. All generation runs through the async POST /v1/tasks endpoint. Same shape for text-to-image, image-to-image, text-to-video, image-to-video. Most image models accept input.prompt + input.aspect_ratio. qwen-image-2.0 uses a DashScope-style nested schema with literal pixel sizes — keep a model→payload adapter map. Four sample images in this post — cover illustration, photoreal portrait, CJK calligraphy signboard, layout poster — were all rendered through hiapi for a total of $0.155.

Read more
FLUX 1.1 Pro on hiapi: Capabilities, Pricing, and a Working Code Example
News

FLUX 1.1 Pro on hiapi: Capabilities, Pricing, and a Working Code Example

FLUX 1.1 Pro is on hiapi at $0.05 per image, flat across aspect ratios — no resolution multiplier. It is served on the async /v1/tasks endpoint, not /v1/chat/completions; use `aspect_ratio` not `size`. Photoreal portraits, product flat-lays, and short headline text render reliably; unprompted text on objects is still hallucinated. Older FLUX.1 Dev and the original FLUX Pro are not on hiapi — the catalogue carries only the 1.1 Pro flagship.

Read moreJun 12, 2026 · 9
Inside Codex's Agent Loop: Lessons from Datadog and Sora's 28-Day Android Launch
Guide
Jun 8, 202612

Inside Codex's Agent Loop: Lessons from Datadog and Sora's 28-Day Android Launch

The Codex agent loop is a simple control flow — prepare prompt, model inference, optional tool call, append result, repeat — that terminates when the model emits a normal assistant message. Three implementation details make it production-grade: prefix caching on the Responses API, tool-call results that live inside the conversation, and termination detected from output shape (not a turn counter). Datadog uses the loop for system-level code review on every PR across 1,000+ engineers; its incident-replay harness showed Codex catching ~22% of historical incident-related issues human reviewers had missed. OpenAI shipped Sora for Android in 28 days with four engineers, ~85% Codex-generated code, and a 99.9% crash-free rate — by scaffolding with exemplars and AGENTS.md, not by prompting 'go build it.' The same agent-loop architecture transfers to media-generation agents built on hiapi: stable system prompt + tool-call accumulation + critique-based termination, wrapping image and video endpoints.

Read more
ChatGPT Image Generation: What's New and How to Build It Programmatically
Guide
Jun 6, 20267

ChatGPT Image Generation: What's New and How to Build It Programmatically

ChatGPT's new image experience is powered by the GPT Image 2 model family — reachable from your own code through a simple two-call async API. The visible improvements (text rendering, character consistency, 4K detail) come from the model layer, not the UI — so the same quality is available to your own application. gpt-image-2 is the flagship at $0.03 per image and handles the majority of production workflows; it replaced gpt-image-1.5, which has been retired from the platform. Migration from ChatGPT to API is small: same prompts work, and the integration is two REST calls — POST /v1/tasks to create a generation, GET /v1/tasks/:id to collect the image URL.

Read more
GPT Image 2 Multi-Turn Editing and Style Consistency: A hiapi Capabilities Tour
Tutorial
Jun 4, 202610

GPT Image 2 Multi-Turn Editing and Style Consistency: A hiapi Capabilities Tour

gpt-image-2 (text-to-image) and gpt-image-2-image-to-image are two halves of the same workflow — first draft and surgical editor — both priced at $0.03 per call at 1K on hiapi. The two patterns that move the needle: a verbatim character bible reused across scenes for series consistency, and a first-render-then-edit two-call flow for any job that must look like an extension of an existing brand asset. Both variants speak the same async task API — POST /v1/tasks, then poll the task ID — the only difference is that the editing variant adds an input_urls array of reference images.

Read more
Does GPT Image 2 Really Nail Text? We Stress-Tested Signage, Posters and Labels
Guide
May 21, 20268

Does GPT Image 2 Really Nail Text? We Stress-Tested Signage, Posters and Labels

Across 24 text-heavy generations — including English headlines, CJK calligraphy, multi-string infographics, embedded brand blocks, currency, and dense UI mockups — every primary string rendered correctly. GPT Image 2 will sometimes add contextually appropriate text you didn't ask for (brand monograms, founding-year badges, scent names). Useful most of the time, undesired occasionally. The remaining ~1% error rate at production scale shows up on the smallest text — sub-12pt captions, dense legal copy, ingredient lists. Always proof at 100% zoom before shipping. If text matters, lock it in straight quotes. Smart quotes get rendered as smart quotes. Special characters (em-dashes, ampersands) work; single-character substitutions are the most common failure mode when they occur.

Read more
Building an E-commerce Product Image Workflow with GPT Image 2
Guide
May 21, 202610

Building an E-commerce Product Image Workflow with GPT Image 2

A full six-step pipeline for producing an e-commerce product listing — main hero, lifestyle, macro detail, ingredient story, promotional banner, launch poster — using GPT Image 2 end-to-end. All six images for one product cost about $0.18 to generate. Wall-clock time: roughly ten minutes including text proofing. Use the same anchor description (the product) across every prompt to keep visual consistency between shots. Always proof rendered text by eye — GPT Image 2 is right ~99% of the time, but the 1% is what ships.

Read more
GPT Image 2 Review: A Hands-On Honest Take
Review
May 21, 20269

GPT Image 2 Review: A Hands-On Honest Take

Text rendering is the real upgrade — English headlines, CJK calligraphy, in-image labels and prices all render correctly the first time. Photorealism is genuinely strong for product photography and detailed interiors. Portraits are good but occasionally read as slightly 'too symmetric'. Speed is a step backward from GPT Image 1.5: ~107 seconds per image versus 18–36 seconds. Plan workflows around it. Hard limit: no transparent backgrounds. If you need PNG cutouts, you're still going to need a second model or a background remover.

Read more

Stay ahead of the curve.

Get the latest model launches, engineering deep-dives, and API tutorials delivered straight to your inbox.

Email subscription is coming soon

No spam. Quality content on AI image & video generation, unsubscribe anytime.