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
| Method | Path | What it does |
|---|---|---|
POST | /v1/images/generations | Generate one or more images from a text prompt |
POST | /v1/images/edits | Edit 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_format | What you get | When to use |
|---|---|---|
"url" (default) | A temporary HTTPS URL | Quick testing and previews |
"b64_json" | Base64-encoded PNG data | Production — store the image immediately |
Supported models
Routeway routes image requests to the underlying provider based on themodel field. A non-exhaustive selection:
| Model | Provider | Best for |
|---|---|---|
flux-1-schnell | Black Forest Labs | Fast generation, low cost |
flux-1-dev | Black Forest Labs | Higher quality, slower |
flux-kontext-max | Black Forest Labs | Image editing with high fidelity |
gpt-image-1 | OpenAI | Photorealistic outputs, instruction-following |
dall-e-3 | OpenAI | Creative, stylised images |
dall-e-2 | OpenAI | Smaller images, lower cost |