Choose a routed image generation API when you need one request shape, predictable dimensions, centralized safety, and failover that never bypasses a moderation rejection.
“Luxury solid ceramic perfume bottle, completely opaque matte lilac glaze, rectangular modern flacon, matching ceramic stopper, thin polished chrome collar, warm travertine plinth, soft peach studio backdrop, commercial product photography, portrait composition”
FLUX Dev · premium · 960 × 1472Keep the product contract stable while the provider layer changes
Direct provider integrations look simple until production traffic arrives. Each service has different model names, output shapes, polling behavior, safety controls, and retry semantics. RenderRoute absorbs those differences behind an OpenAI-familiar POST /v1/images/generations contract, so the client sends a prompt, dimensions, quality tier, and output format in the same shape every time.
The default fast lane targets Runware FLUX.1 schnell. Together and Leonardo remain eligible fallbacks for transient failures. Premium requests use a separate route led by FLUX.1 dev, preventing an expensive model from being selected by accident. Provider-specific model IDs are still available when an API client explicitly pins a provider.
- Normalize vendor responses into URL or base64 image data
- Expose provider, model, latency, dimensions, and fallback attempts in response metadata
- Use idempotency keys to avoid duplicate paid generations after a client retry
Fail over only when it is safe to do so
A fallback router should not treat every error as permission to try again elsewhere. RenderRoute only advances on transient conditions such as timeouts, rate limits, and selected 5xx responses. Invalid dimensions, account-policy failures, prompt moderation rejections, and other non-retryable errors stop immediately.
That distinction protects both cost and policy integrity. It also makes incidents diagnosable: every response records the attempt path, while the database stores prompt hashes rather than raw prompts by default. Circuit breakers temporarily remove repeatedly failing providers from the active path.
| Condition | Action | Why |
|---|---|---|
| Timeout or 429 | Retry, then eligible fallback | Likely temporary |
| Provider 5xx | Retry, then eligible fallback | Service instability |
| Invalid request | Stop | Same request is likely invalid elsewhere |
| Safety rejection | Stop | Never bypass policy with another vendor |
Make the first request from any HTTP client
The public API is designed for backend-to-backend use. Keep the RenderRoute key on your server, pass a unique idempotency key for operations that may be retried, and let the response metadata tell you whether dimensions were adjusted or a fallback was used.
The portrait preset is already valid for the cross-provider rule because both 960 and 1472 divide evenly by 64. When a client sends another size, auto_adjust_dimensions can snap it to the nearest compatible value or be disabled for strict validation.
curl https://renderroute.app/v1/images/generations \
-H 'Authorization: Bearer $RENDERROUTE_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: product-shot-4821-v1' \
-d '{
"prompt": "Editorial product portrait on a warm stone pedestal",
"quality": "fast",
"width": 960,
"height": 1472,
"n": 1
}'Treat reliability, safety, and measurement as one system
A production image API needs more than a model call. RenderRoute includes rate limiting, API-key scopes, privacy-preserving usage logs, provider circuit breakers, a moderation interface, separate adult-mode authorization, health endpoints, and startup checks that reject unsafe production configuration.
The same instrumentation supports SEO and sales. Publish first-party latency and cost studies only after running the included benchmark script against the live deployment. Date every benchmark, describe the dimensions and settings, and keep marketing claims tied to reproducible evidence rather than a vendor price copied out of context.
Questions about image generation API
Which provider does RenderRoute call first?
The default fast route is configured for Runware FLUX.1 schnell. The order is environment-controlled, and eligible transient failures can move to Together, Leonardo, or a local OpenAI-compatible endpoint.
Is the API tied to one image model?
No. Clients can use the fast or premium abstraction, or pin a provider and model ID when they need provider-specific behavior.
Does fallback happen after a moderation rejection?
No. Safety and other non-retryable rejections stop the request. Fallback is reserved for transient operational failures.
Can the API return base64 instead of a URL?
Yes. Set response_format to b64_json. URL responses are usually better for latency and payload size.