Image generation on relay sites: how DALL-E, Flux and Midjourney actually differ
Three shapes, three ways to call them
Text endpoints have an industry standard, the OpenAI-compatible one. Image generation does not. Image generation on relay sites falls roughly into three categories.
One: the OpenAI-style synchronous endpoint
POST /v1/images/generations
{"model":"dall-e-3","prompt":"...","size":"1024x1024","n":1}
It returns JSON containing a URL or base64. It is synchronous: one request, then wait for the result.
- Advantage: simple, in the same style as text endpoints.
- Drawback: generation takes a while, anywhere from fifteen seconds to a minute, so timeouts are easy to hit.
- Models covered: the DALL-E family and some OpenAI-compatible Flux implementations.
Two: the Midjourney-style asynchronous task endpoint
A completely different shape:
POST /mj/submit/imagine -> returns a taskId
GET /mj/task/{taskId}/fetch -> poll until status becomes SUCCESS
- Polling is mandatory. There is no synchronous return.
- The response structure is Midjourney's own, carrying imageUrl, progress percentage and so on.
- The MJ path differs from site to site.
/mj/,/midjourney/and/v1/mj/have all been seen. - Billing is per task, unrelated to tokens.
This is also a consequence of Midjourney having no public API. Every MJ interface on the market is someone's reverse-engineered or proxied shape, so there is no standard.
Three: vendor-specific custom shapes
Flux, the Stable Diffusion family and domestic text-to-image models are often exposed by relay sites in a custom shape. The path may be /v1/images/generations, dressed up to look OpenAI-style, or something entirely bespoke.
Confirm the billing basis separately
| Shape | Common billing unit |
|---|---|
| DALL-E family | Per image, with different prices per size |
| MJ family | Per task, where one imagine counts as one task |
| Flux family | Per image or per step |
| Custom shapes | Wildly inconsistent |
The key trap: image generation is not billed by token, so the word "multiplier" means something completely different here. Some sites print "image generation at 3x". You have to ask what the 3x is relative to — $0.04 per image officially, or something else.
Recommendation: just ask the site. This is one of the few questions where asking produces an answer, and the exchange can be kept as a record.
Five common failures
1. Timeout, the most common
On a synchronous endpoint, generating one 1024x1024 image routinely takes 15 to 60 seconds. If the gateway or your client has a 30-second timeout, the call fails.
Signature: the request reports a timeout, but the site's dashboard shows the task completed successfully and was charged.
What to do: raise the timeout past 120 seconds, or prefer an asynchronous polling endpoint.
2. The image URL is not reachable
An image URL returned by a synchronous endpoint may be:
- a temporary signed link that expires within hours, so you must download and re-host immediately;
- pointing at the upstream's domain, which may not be directly reachable in your region, so it will not open in a browser.
What to do: download the image the moment you get the URL. Do not store it in your database as a long-term resource link.
3. Content moderation rejection
Image generation is moderated far more strictly than text, and moderation may happen at the relay layer, since it added a check of its own.
Signature: the error message is the relay site's own wording rather than the upstream's, and the same prompt passes on another site.
4. The n parameter has no effect
The OpenAI endpoint supports n to request several images. Some sites ignore it and always return one.
Test: send n=2 and check the length of the returned array.
5. Differences in non-English prompt support
Models differ enormously in how well they understand prompts in other languages. Some models, particularly those trained mostly on English, produce images from a non-English prompt that clearly miss the intent.
What to do: write the prompt in English, or run it through a text model once to translate or expand it before sending. That is also what most practitioners do.
A self-test sequence
| # | Test | Criterion |
|---|---|---|
| 1 | The simplest prompt, a solid colour image | Returns, and the result is downloadable |
| 2 | Record the elapsed time | Decides whether you need async or a longer timeout |
| 3 | n=2 | The returned array has length 2 |
| 4 | One non-English and one English prompt | Reveals how well non-English is supported |
| 5 | Download the returned URL locally | Confirms reachability, and characterises the URL's lifetime |
| 6 | Deliberately send a prompt that trips moderation | See which layer the error wording comes from |
Item 6 has extra value: the style of the error text tells you whether moderation sits at the relay or upstream. A relay with its own moderation implies tighter boundaries.
Selection advice
Image generation has a selection principle that differs from text: look at the interface shape before the price.
The reasoning:
- A synchronous endpoint looks simpler, but timeout problems will make it fail often in production.
- An asynchronous endpoint costs twenty extra lines of polling code and is far more stable.
- If a site offers both, always pick the asynchronous one.
Price can be negotiated later. The interface shape determines your code structure and your failure rate.
Was this useful? If you have run into something the article does not cover, tell us and we will verify it and update the text.
Related articles
Video generation behind a relay: three API shapes, four billing traps, one acceptance checklist
MCP through a relay: what works, what never will, and how to test it in ten minutes
A relay selection decision tree: working back from your scenario to a site
Logging and reconciliation: attributing token spend to the project level
Migrating suppliers gradually: replacing an API site without interrupting service
Build your own probe: twenty lines of script to monitor your API suppliers
Read on: a few of the services we list
This article does not point at a specific model family, so here are a few of the highest-scoring services we list, in case you want to read on. They are ordered by score and uptime and are not a recommendation.
See the full list in the directory, or browse by model family.