> ## Documentation Index
> Fetch the complete documentation index at: https://docs.routeway.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Image Generation

> Generate and edit images from text prompts using Routeway's image models.

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

<CardGroup cols={2}>
  <Card title="Generating Images" icon="wand-sparkles" href="/core-concepts/image-generation/generating-images">
    Turn a text prompt into an image. Covers models, sizes, quality presets, response formats, and saving images locally.
  </Card>

  <Card title="Editing Images" icon="pencil" href="/core-concepts/image-generation/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`.
  </Card>
</CardGroup>

***

## Endpoints

| Method | Path                                                                    | What it does                                            |
| ------ | ----------------------------------------------------------------------- | ------------------------------------------------------- |
| `POST` | [`/v1/images/generations`](/api-reference/ImageGenerations/generations) | Generate one or more images from a text prompt          |
| `POST` | [`/v1/images/edits`](/api-reference/ImageEdits/edits)                   | Edit an existing image using a prompt and optional mask |

<Info>
  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.
</Info>

***

## 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 |

<Warning>
  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.
</Warning>

***

## Supported models

Routeway routes image requests to the underlying provider based on the `model` 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                    |

Check the [Models catalog](https://routeway.ai/models) for the full list and current pricing.
