Pick the text-to-image API that makes its response contract easy to test, then hide that contract behind your own Node.js adapter.

That is the choice I make for a web app in 2026. Developer experience matters, but a polished SDK cannot rescue an ambiguous payload, an undocumented asynchronous state, or an image URL that expires before my worker stores it. I want docs, an SDK only where it saves real work, and a response format I can validate at the boundary.

The experiment: a pretty demo versus a boring contract

I ran the same prompt through three API shapes: an immediate binary response, a JSON response containing a URL, and a job response that required polling. The first shape was fast to demo but awkward for retries. The second fit a browser-facing workflow, provided I copied the bytes into durable storage. The third was the most operationally honest for slow generation, but it added state, idempotency, and a queue to my small app.

The failure that changed my checklist was a cost surprise. I estimated a weekend image feature at about $40, then the invoice landed at $186. The culprit wasn't one expensive image; my retry loop regenerated an image after a client timeout, and the browser also retried a form submission. I had measured successful requests, not attempts. That number is why I now log a request ID, prompt hash, retry count, and final image ID before I call a generation API.