Skip to main content
Routeway exposes two image endpoints that mirror the OpenAI images API — so any code that calls api.openai.com/v1/images/generations works against Routeway with only a base URL swap.

What’s in this section

Generating Images

Turn a text prompt into an image. Covers models, sizes, quality presets, response formats, and saving images locally.

Editing Images

Modify an existing image with a prompt and optional mask. Covers inpainting, multi-image edits, and advanced parameters like strength and guidance_scale.

Endpoints

MethodPathWhat it does
POST/v1/images/generationsGenerate one or more images from a text prompt
POST/v1/images/editsEdit an existing image using a prompt and optional mask
Image models use dedicated endpoints — they are not available on /v1/chat/completions. Use the OpenAI SDK’s client.images.generate() and client.images.edit() helpers, or call the endpoints directly with cURL.

Response formats

Both endpoints support two ways to receive the result:
response_formatWhat you getWhen to use
"url" (default)A temporary HTTPS URLQuick testing and previews
"b64_json"Base64-encoded PNG dataProduction — store the image immediately
URLs returned by the API expire after 1 hour. Download and store any image you want to keep — don’t rely on the URL long-term.

Supported models

Routeway routes image requests to the underlying provider based on the model field. A non-exhaustive selection:
ModelProviderBest for
flux-1-schnellBlack Forest LabsFast generation, low cost
flux-1-devBlack Forest LabsHigher quality, slower
flux-kontext-maxBlack Forest LabsImage editing with high fidelity
gpt-image-1OpenAIPhotorealistic outputs, instruction-following
dall-e-3OpenAICreative, stylised images
dall-e-2OpenAISmaller images, lower cost
Check the Models catalog for the full list and current pricing.